-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-32873: Remove a name hack for generic aliases in typing module #6376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lib/typing.py
Outdated
@@ -629,7 +642,10 @@ def __init__(self, origin, params, *, inst=True, special=False, name=None): | |||
self._special = special | |||
if special and name is None: | |||
orig_name = origin.__name__ | |||
name = orig_name[0].title() + orig_name[1:] | |||
if orig_name in _normalize_alias: | |||
name = _normalize_alias[orig_name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = _normalize_alias.get(orig_name, orig_name)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, interesting suggestion, let's go with it.
Thanks @ilevkivskyi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
GH-6378 is a backport of this pull request to the 3.7 branch. |
…ythonGH-6376) This removes a hack and replaces it with a proper mapping {'list': 'List', 'dict': 'Dict', ...}. (cherry picked from commit 2a363d2) Co-authored-by: Ivan Levkivskyi <[email protected]>
…H-6376) This removes a hack and replaces it with a proper mapping {'list': 'List', 'dict': 'Dict', ...}. (cherry picked from commit 2a363d2) Co-authored-by: Ivan Levkivskyi <[email protected]>
This removes a hack and replaces it with a proper mapping
{'list': 'List', 'dict': 'Dict', ...}
.https://bugs.python.org/issue32873