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 ncoghlan
Recipients ncoghlan, petr.viktorin, xiang.zhang
Date 2016-08-17.07:26:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471418777.79.0.00941131594929.issue27782@psf.upfronthosting.co.za>
In-reply-to
Content
Loosening the constraint on PyModule_GetNameObject would indeed work, but it means the code still has a readability problem: the convention in the C API is that officially ducktyped APIs use the PyObject_* prefix, or one of the other abstract protocols (PyNumber_*, PyMapping_*, etc), rather than a concrete type name like PyModule_*. Relying on folks to "just know" that these particular APIs deliberately don't enforce the type constraint is a recipe for future confusion, even if it's documented that way.

Such a change also has potential ripple effects on other implementations that emulate the C API, and hence isn't something I'd be comfortable with changing in a maintenance release, whereas fixing the implementation to match the PEP could be done for the next 3.5.x update.
History
Date User Action Args
2016-08-17 07:26:17ncoghlansetrecipients: + ncoghlan, petr.viktorin, xiang.zhang
2016-08-17 07:26:17ncoghlansetmessageid: <1471418777.79.0.00941131594929.issue27782@psf.upfronthosting.co.za>
2016-08-17 07:26:17ncoghlanlinkissue27782 messages
2016-08-17 07:26:16ncoghlancreate