Re: What a curious assignment.

2005-11-22 Thread Naveed
"A.i" is a class attribute.  "a.i" at first is the same as "A.i".  Once
you set a.i = 2, you are actually creating a new data attribute called
i for the instance a.  This happens on the fly.  So then when you
reference a.i, it uses the instance data attribute, instead of the
class attribute.

This might make it more clear.  Try:
a.f = 3
print a.f
Even though f is not declared in your class definition, the above code
still prints 3.  Because it created the data attribute f on the fly.

-- 
http://mail.python.org/mailman/listinfo/python-list


Free E-Books collection

2010-11-09 Thread naveed ahmed
Freeit http://freeit11.blogspot.comis the world's leading online
source of ebooks, with a vast range of

ebooks from academic,
Popular and professional publishers.

Freeit http://freeit11.blogspot.com eBook communicates my vision of
exploring the whole universe to you.

What if you
had a plausible method (based on today's science and technology)
freeit large selection of eBooks. New eBook releases and bestsellers
in
over 40 categories including science fiction, romance, mystery,
for more e-books visit Freeit
-- 
http://mail.python.org/mailman/listinfo/python-list