Skip to content

Conversation

@ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Apr 4, 2018

This removes a hack and replaces it with a proper mapping {'list': 'List', 'dict': 'Dict', ...}.

https://bugs.python.org/issue32873

Lib/typing.py Outdated
orig_name = origin.__name__
name = orig_name[0].title() + orig_name[1:]
if orig_name in _normalize_alias:
name = _normalize_alias[orig_name]
Copy link
Member

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)

?

Copy link
Member Author

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.

@ilevkivskyi ilevkivskyi merged commit 2a363d2 into python:master Apr 5, 2018
@miss-islington
Copy link
Contributor

Thanks @ilevkivskyi for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@ilevkivskyi ilevkivskyi deleted the fix-name-hack branch April 5, 2018 00:25
@bedevere-bot
Copy link

GH-6378 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 5, 2018
…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]>
miss-islington added a commit that referenced this pull request Apr 5, 2018
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants