Skip to content

Disable promotions when restricting types in isinstance checks - #6142

Merged
msullivan merged 1 commit into
masterfrom
promotions
Jan 4, 2019
Merged

msullivan merged 1 commit into
masterfrom
promotions

Conversation

@msullivan

Copy link
Copy Markdown
Collaborator

This fixes a bug left behind by #6114, where too much would get
subtracted out of a union type after an isinstance.

Fixes #6141.

This fixes a bug left behind by #6114, where too much would get
subtracted out of a union type after an isinstance.

Fixes #6141.
@msullivan
msullivan requested a review from Michael0x2a January 4, 2019 21:58

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Nice catch!

@Michael0x2a Michael0x2a left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@msullivan

Copy link
Copy Markdown
Collaborator Author

Argh the test failure is the windows IPC flake, merging

@msullivan
msullivan merged commit 103f5f3 into master Jan 4, 2019
@msullivan
msullivan deleted the promotions branch January 4, 2019 22:16
Michael0x2a added a commit to Michael0x2a/mypy that referenced this pull request Jan 11, 2019
This pull request reverts python#6114
and python#6142: see
python#6180 for rationale.

In short, the original fix ended up being more disruptive then
anticipated: it's modifying str and unicode semantics, and we should
put a little more thought into reasoning about that particular case
before moving ahead with any fix here.

This should also help unblock the upcoming 0.660 release.
Michael0x2a added a commit that referenced this pull request Jan 11, 2019
This pull request reverts #6114
and #6142: see
#6180 for rationale.

In short, the original fix ended up being more disruptive then
anticipated: it's modifying str and unicode semantics, and we should
put a little more thought into reasoning about that particular case
before moving ahead with any fix here.

This should also help unblock the upcoming 0.660 release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Else block of isinstance check with promotable types has <nothing> for type

3 participants