Alexander Böhn <fish2...@gmail.com> added the comment:

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()` ?

----------

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

Reply via email to