Author ncoghlan
Recipients levkivskyi, ncoghlan
Date 2017-12-10.00:39:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512866356.6.0.213398074469.issue32225@psf.upfronthosting.co.za>
In-reply-to
Content
For documentation of this feature, I'd suggest adding a new subsection after https://docs.python.org/3/reference/datamodel.html#customizing-attribute-access (but at the same level), called "Customizing module attribute access".

That can then cover defining __getattr__ and __dir__ as module level functions, and also mention setting __class__ (which would be enough to close issue 27505 as well).

The new section should explicitly mention that these only affect lookups and modifications made using the attribute access syntax - directly accessing the module globals (whether by code within the module, or via a reference to the module's globals dict) is unaffected.
History
Date User Action Args
2017-12-10 00:39:16ncoghlansetrecipients: + ncoghlan, levkivskyi
2017-12-10 00:39:16ncoghlansetmessageid: <1512866356.6.0.213398074469.issue32225@psf.upfronthosting.co.za>
2017-12-10 00:39:16ncoghlanlinkissue32225 messages
2017-12-10 00:39:16ncoghlancreate