GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-104874: Document NewType.__supertype__ by JelleZijlstra · Pull Request #104875 · python/cpython Conversation
|
| def test_special_attrs(self): | |
| self.assertEqual(UserId.__name__, 'UserId') | |
| self.assertEqual(UserId.__qualname__, 'UserId') | |
| self.assertEqual(UserId.__module__, __name__) | |
| self.assertEqual(UserId.__supertype__, int) | |
| UserName = self.UserName | |
| self.assertEqual(UserName.__name__, 'UserName') | |
| self.assertEqual(UserName.__qualname__, | |
| self.__class__.__qualname__ + '.UserName') | |
| self.assertEqual(UserName.__module__, __name__) | |
| self.assertEqual(UserName.__supertype__, str) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I feel like it could be useful to be able to know the module the newtype was defined in, and it seems useful to mention the ways in which instances of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @JelleZijlstra for the PR, and @AlexWaygood for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit 41768a2) Co-authored-by: Jelle Zijlstra <[email protected]>
|
GH-104906 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit 41768a2) Co-authored-by: Jelle Zijlstra <[email protected]>
|
GH-104907 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
DocumentNewType.__supertype__
There was an error while loading. Please reload this page.