Commit 488ad4f
authored
I modified
```diff
diff --git mypy/binder.py mypy/binder.py
index 8a68f24..194883f86 100644
--- mypy/binder.py
+++ mypy/binder.py
@@ -345,7 +345,7 @@ class ConditionalTypeBinder:
self._cleanse_key(dep)
def most_recent_enclosing_type(self, expr: BindableExpression, type: Type) -> Type | None:
- type = get_proper_type(type)
+ # type = get_proper_type(type)
if isinstance(type, AnyType):
return get_declaration(expr)
key = literal_hash(expr)
```
to see if it still works. It is:
```python
» python runtests.py self
run self: ['/Users/sobolev/Desktop/mypy/.venv/bin/python', '-m', 'mypy', '--config-file', 'mypy_self_check.ini', '-p', 'mypy', '-p', 'mypyc']
mypy/binder.py:349: error: Never apply isinstance() to unexpanded types; use
mypy.types.get_proper_type() first [misc]
if isinstance(type, AnyType):
^~~~~~~~~~~~~~~~~~~~~~~~~
mypy/binder.py:349: note: If you pass on the original type after the check, always use its unexpanded version
Found 1 error in 1 file (checked 288 source files)
FAILED: self
```
I will add this plugin to my CI checks in like ~5 plugins I maintain :)
- https://github.com/typeddjango/django-stubs
- https://github.com/typeddjango/djangorestframework-stubs
- https://github.com/dry-python/returns
- https://github.com/dry-python/classes
- https://github.com/wemake-services/mypy-extras
Closes #16035
1 parent 92e054b commit 488ad4f
File tree
4 files changed
+19
-2
lines changed- docs/source
- mypy/plugins
4 files changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
2 | 11 | | |
3 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments