-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Raise errors on unbound TypeVars with values #15732
Conversation
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
…into typevars-with-values
Diff from mypy_primer, showing the effect of this PR on open source code: mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/tools/console/grideditor/base.py:22: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]
operator (https://github.com/canonical/operator)
+ ops/pebble.py:245: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]
|
I will send them PRs with the fix. |
Hi! While working on python/mypy#15732 our tools detected a misuse of `AnyStr` TypeVar (which is quite common). The proper way is to use `Union` here :)
Hi! While working on python/mypy#15732 our tools detected a misuse of AnyStr TypeVar (which is quite common). The proper way here is to use `@overload`s :)
* Remove incorrect usage of `typing.AnyStr` Hi! While working on python/mypy#15732 our tools detected a misuse of AnyStr TypeVar (which is quite common). The proper way here is to use `@overload`s :) * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Hi! While working on python/mypy#15732 our tools detected a misuse of `AnyStr` TypeVar (which is quite common). The proper way is to use `Union` here :)
* Remove incorrect usage of `typing.AnyStr` Hi! While working on python/mypy#15732 our tools detected a misuse of AnyStr TypeVar (which is quite common). The proper way here is to use `@overload`s :) * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Completes a
TODO
item :)Refs #15724