Style question - defining immutable class data members

Torsten Bronger bronger at
Sat Mar 14 22:49:54 CET 2009


Maxim Khitrov writes:

> [...]
> The advantage of doing this is that the assignments are evaluated
> once and thus the creation of that class is a bit faster. Access
> is still performed through self.some_value and
> self.another_value. Is there a reason to prefer the first style
> over the second?

I think that tools like epydoc can generate more accurate API
documentation if you write them as instance attributes.


Torsten Bronger, aquisgrana, europa vetus
                   Jabber ID: torsten.bronger at

More information about the Python-list mailing list