This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients
Date 2005-07-31.13:21:05
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
PyObject_Dir checks if the __dict__ of an object is a dict, if not it is 
ignored. It should also accept dictproxies.

My usecase is an object that doesn't have a real dict, but looks up 
attributes in another datastructure. When someone asks for the 
__dict__ of this object I'm dynamicly building a new dictionary. I'd 
like the __dict__ property to be a immutable value because changing 
it won't (and shouldn't) affect the underlying object. 

However, when I return the result of a call to PyDict_NewProxy the 
builtin function dir will no longer use the contents of the __dict__ 
attribute, which is counterproductive because supporting dict is a 
major usecase for supporting a __dict__ attribute in the first place!
History
Date User Action Args
2007-08-23 14:33:26adminlinkissue1248658 messages
2007-08-23 14:33:26admincreate