Advogato post for 2001-04-03 19:47:44

There should be a easy way to see who names you, so that northrup would see this:

In python, all members are instance members, if created outside of the class definition, unless you specifically create them as members of the class.

For example:

class a:
 pass
inst_a=a()
inst_b=a()
inst_a.memb_a=3
print inst_a.memb_a
3
print inst_b.memb_a
Traceback (innermost last):
File "<stdin>", line 1, in ?
AttributeError: memb_a
a.memb_class=5
print inst_b.memb_class
5

Hope that made any sense :-)

Comments

Comments powered by Disqus