Message327610
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()` ? |
|
Date |
User |
Action |
Args |
2018-10-12 20:10:53 | fish2000 | set | recipients:
+ fish2000, serhiy.storchaka, levkivskyi |
2018-10-12 20:10:53 | fish2000 | set | messageid: <1539375053.66.0.788709270274.issue34963@psf.upfronthosting.co.za> |
2018-10-12 20:10:53 | fish2000 | link | issue34963 messages |
2018-10-12 20:10:53 | fish2000 | create | |
|