[issue2040] Class instance attributes that are property() should appear in __dict__

2008-02-08 Thread Christian Heimes
Christian Heimes added the comment: Please take the question to the Python general mailing list. I'm sure several people are able to explain it to you. The bug tracker isn't the right place. __ Tracker <[EMAIL PROTECTED]> ___

[issue2040] Class instance attributes that are property() should appear in __dict__

2008-02-07 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Well, a regular method also takes "self" as its first argument. And it will not appear in the instance's __dict__. The __dict__ of an object is intended to *store* its attributes. A property can be accessed like an attribute (foo_obj.bar), but it is comput

[issue2040] Class instance attributes that are property() should appear in __dict__

2008-02-07 Thread Jag Ginsberg
Jag Ginsberg added the comment: I appreciate your quick response, and I certainly hope you won't read this as me being anything but ignorant, but how can a property whose function definitions include "self" be "about" the class and not the instance? I agree that Foo.__dict__ should include the

[issue2040] Class instance attributes that are property() should appear in __dict__

2008-02-07 Thread Christian Heimes
Christian Heimes added the comment: Descriptors like properties are bound to the class and not to the instance. The behavior is consistent with class attributes and methods: >>> class Foo: ... a = 1 ... bar = property(lambda self: 'baz') ... >>> dict(Foo.__dict__) {'a': 1, '__module__':

[issue2040] Class instance attributes that are property() should appear in __dict__

2008-02-07 Thread Jag Ginsberg
New submission from Jag Ginsberg: If I have a class: class Foo(object): bar = property(lambda self: 'baz') # ignore the value's trivial nature and then run: >>> foo_obj = Foo() >>> foo_obj.__dict__ ... I would expect to see: {'bar': 'baz'} ... and not: {} This would seem consistent with