Message272908
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. |
|
Date |
User |
Action |
Args |
2016-08-17 07:26:17 | ncoghlan | set | recipients:
+ ncoghlan, petr.viktorin, xiang.zhang |
2016-08-17 07:26:17 | ncoghlan | set | messageid: <1471418777.79.0.00941131594929.issue27782@psf.upfronthosting.co.za> |
2016-08-17 07:26:17 | ncoghlan | link | issue27782 messages |
2016-08-17 07:26:16 | ncoghlan | create | |
|