Skip to content
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

Add NewType for normalized names #292

Merged
merged 6 commits into from
Apr 8, 2020

Conversation

pradyunsg
Copy link
Member

@pradyunsg pradyunsg commented Apr 5, 2020

Fixes #290, built on top of #291.

Newer versions of mypy are better at following code flow, and assign
Any types to our reimplemented cast function. This commit significantly
restructures our typing.cast re-definition, to make it more robust.
This allows for some significant cleanups in our typing helpers, and
makes it much easier to document our... workarounds.
CHANGELOG.rst Outdated Show resolved Hide resolved
@pradyunsg pradyunsg merged commit 61672bf into pypa:master Apr 8, 2020
@pradyunsg pradyunsg deleted the normalized-name-newtype branch April 8, 2020 12:54
@pradyunsg pradyunsg mentioned this pull request Apr 15, 2020
aixtools pushed a commit to aixtools/packaging that referenced this pull request Apr 20, 2020
* Make our mypy type-casting magic more robust

Newer versions of mypy are better at following code flow, and assign
Any types to our reimplemented cast function. This commit significantly
restructures our typing.cast re-definition, to make it more robust.

* Rename MYPY_CHECK_RUNNING -> TYPE_CHECKING

This allows for some significant cleanups in our typing helpers, and
makes it much easier to document our... workarounds.

* Bump to newer mypy

* Improve `canonicalize_name` safety with type hints
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.

Improve canonicalize_name safety with type hints
3 participants