You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be very helpful for plugin developers, because in my own code I have a lot of warnings when I use this plugin.
The error is really common, so the need is quite high.
Since it does not have any 3rd party dependencies, we are also free to just move it to mypy/plugins
I modified
```diff
diff --git mypy/binder.py mypy/binder.py
index 8a68f24f6..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-extrasCloses#16035
It might be very helpful for plugin developers, because in my own code I have a lot of warnings when I use this plugin.
The error is really common, so the need is quite high.
Since it does not have any 3rd party dependencies, we are also free to just move it to
mypy/plugins
We can also add a note about it in the docs: https://mypy.readthedocs.io/en/stable/extending_mypy.html
The text was updated successfully, but these errors were encountered: