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 fish2000
Recipients fish2000, levkivskyi, serhiy.storchaka
Date 2018-10-12.20:10:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1539375053.66.0.788709270274.issue34963@psf.upfronthosting.co.za>
In-reply-to
Content
The proposed solution in the PR replaces the identity-function return value of `NewType(…)` with a callable class instance that adds an explicit `__repr__` function – which that function cobbles together the string representations of the supplied type and the new types’ name into a sensible and stylistically consistent “repr” output. 

In this capacity the `__name__` vs. `__qualname__` consideration would appear to be an implementation detail – in this case, calculating a `__qualname__` value, á la PEP-3155, doesn’t seem to be possible nor advantageous, in this specific case.

On the other hand, adding `__module__` seems like it’d be a win – although I am wary about introducing a dependency on a function that starts with an underscore. How reliable and/or portable is `sys._getframe()` ?
History
Date User Action Args
2018-10-12 20:10:53fish2000setrecipients: + fish2000, serhiy.storchaka, levkivskyi
2018-10-12 20:10:53fish2000setmessageid: <1539375053.66.0.788709270274.issue34963@psf.upfronthosting.co.za>
2018-10-12 20:10:53fish2000linkissue34963 messages
2018-10-12 20:10:53fish2000create