Code redundancy

Xavier Ho contact at xavierho.com
Tue Apr 20 18:08:22 EDT 2010


On Wed, Apr 21, 2010 at 7:59 AM, Alan Harris-Reid <
aharrisreid at googlemail.com> wrote:

> The code is not usually in class.__init__ (otherwise I would have used the
> self. prefix)


Alan, if your variables are not usually in __init__, what's preventing you
from using class variables like this:

>>> class Test():
...     something = 1
...     more = 2
...
>>> Test.more
2

What's your use case?

Cheers,
Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100421/42648d5c/attachment.html>


More information about the Python-list mailing list