static? + some stuff
Alex Martelli
aleax at aleax.it
Tue Nov 4 13:17:03 EST 2003
Daniel Schüle wrote:
> [...]
>
>> a, b, c and my_id *are* class attributes. They are actually inherited by
>
> just to adjust myself to the Python's terminology
> is the word "member" not widely used in Python?
> is it better to say "attributes"?
> (for both member functions and member variables)
Yes, for example the built-in function for accessing, checking etc
are named getattr, hasattr, setattr, delattr
> from you code above i dont see the declarations of c, my_id ...
No declarations: a name springs into existence when you first assign to it
(or otherwise bind it, e.g. with a 'def name():...' statement).
It's most readable if you assign all of an instance's attributes
in the __init__ method -- it's not mandatory, but it's what is most
normally done and expected, whence the readability "from habit".
Alex
More information about the Python-list
mailing list