Author amaury.forgeotdarc
Recipients ajaksu2, amaury.forgeotdarc, chris.jerdonek, ezio.melotti, r.david.murray, ysj.ray
Date 2010-07-22.07:01:24
SpamBayes Score 0.021981
Marked as misclassified No
Message-id <1279782087.6.0.682739591098.issue8297@psf.upfronthosting.co.za>
In-reply-to
Content
I also like the idea; 3 remarks though:

- the patch introduces a new function that returns a PyObject*, but returns NULL when """the attribute is not found, and the caller should raise AttributeError""".
This convention is not standard among the Python API and dangerous IMO.
This part of the patch is not necessary. PyModule_GetAttr could just call PyObject_GenericGetAttr and override the current exception with a new message.

- it's not necessary to expose the function PyModule_GetAttr. It could be renamed to something like module_getattr, and be a static function.  Module writers are already used to PyObject_GetAttr to access the module items, this new function brings nothing new.

- a minor nit: instead of 
    module object 'mod_name' has no attribute 'xxx'
I'd prefer
    module 'mod_name' has no attribute 'xxx'
History
Date User Action Args
2010-07-22 07:01:27amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, ajaksu2, ezio.melotti, r.david.murray, chris.jerdonek, ysj.ray
2010-07-22 07:01:27amaury.forgeotdarcsetmessageid: <1279782087.6.0.682739591098.issue8297@psf.upfronthosting.co.za>
2010-07-22 07:01:25amaury.forgeotdarclinkissue8297 messages
2010-07-22 07:01:24amaury.forgeotdarccreate