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 Trundle
Recipients Trundle, daniel.urban, eric.araujo, michael.foord
Date 2011-04-09.02:01:29
SpamBayes Score 2.8519798e-11
Marked as misclassified No
Message-id <1302314490.94.0.782015619517.issue11770@psf.upfronthosting.co.za>
In-reply-to
Content
A first patch, misses any documentation changes. While working on it, I realised that modules technically shadow the __dict__ attribute (because modules use tp_dictoffset, hence module have a __dict__ member that points to the instance dict). I updated `_shadowed_dict()` so that it now disregards member descriptors as shadowing (as they will never trigger any code execution), but theoretically, the members can be any object (not just dicts), so I have to think a bit more about that case (as a custom object still can trigger code execution).

Also, `dir_static()` behaves slightly different from `dir()` (e.g. `dir()` raises a `TypeError` if the module's "__dict__" attribute isn't a dictionary, which is kind of impossible for `dir_static` as it doesn't even try to acccess `__dict__` if it is shadowed), but IMHO such edge-cases are expected to behave differently for a static version and hence we don't care at all about that.
History
Date User Action Args
2011-04-09 02:01:31Trundlesetrecipients: + Trundle, eric.araujo, michael.foord, daniel.urban
2011-04-09 02:01:30Trundlesetmessageid: <1302314490.94.0.782015619517.issue11770@psf.upfronthosting.co.za>
2011-04-09 02:01:30Trundlelinkissue11770 messages
2011-04-09 02:01:30Trundlecreate