Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.3k
Rework narrowing logic for equality and identity#20492
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
28fefe6cce6a71cdbd7374dbd1074a552d5ca5120d94c5be792051d9586d2a17bc5dac1ef7ab75cc76be54b4c8ece2728eFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -194,12 +194,12 @@ def test_generic_function_type(self) -> None: | ||
| def test_type_alias_expand_once(self) -> None: | ||
| A, target = self.fx.def_alias_1(self.fx.a) | ||
| assert get_proper_type(A) == target | ||
| assert get_proper_type(target) == target | ||
| assert get_proper_type(A) == target | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fun, from this assert mypy now knows that | ||
| A, target = self.fx.def_alias_2(self.fx.a) | ||
| assert get_proper_type(A) == target | ||
| assert get_proper_type(target) == target | ||
| assert get_proper_type(A) == target | ||
| def test_recursive_nested_in_non_recursive(self) -> None: | ||
| A, _ = self.fx.def_alias_1(self.fx.a) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4920,6 +4920,7 @@ def test_setattr() -> None: | ||
| assert i.one == 1 | ||
| assert i.two == None | ||
| assert i.const == 42 | ||
| i = i | ||
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests have a "check initial values" then call | ||
| i.__setattr__("two", "2") | ||
| assert i.two == "2" | ||
| @@ -4957,6 +4958,7 @@ def test_setattr_inherited() -> None: | ||
| assert i.one == 1 | ||
| assert i.two == None | ||
| assert i.const == 42 | ||
| i = i | ||
| i.__setattr__("two", "2") | ||
| assert i.two == "2" | ||
| @@ -4996,6 +4998,7 @@ def test_setattr_overridden() -> None: | ||
| assert i.one == 1 | ||
| assert i.two == None | ||
| assert i.const == 42 | ||
| i = i | ||
| i.__setattr__("two", "2") | ||
| assert i.two == "2" | ||
| @@ -5064,6 +5067,7 @@ def test_setattr_nonnative() -> None: | ||
| assert i.one == 1 | ||
| assert i.two == None | ||
| assert i.const == 42 | ||
| i = i | ||
| i.__setattr__("two", "2") | ||
| assert i.two == "2" | ||
| @@ -5134,6 +5138,8 @@ def test_no_setattr_nonnative() -> None: | ||
| object.__setattr__(i, "three", 102) | ||
| assert i.three == 102 | ||
| i = i | ||
| del i.three | ||
| assert i.three == None | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
A little unfortunate, because
infer_python_executablehas side effects we infer more code as unreachable