Nick Coghlan added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27782>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to