-
Notifications
You must be signed in to change notification settings - Fork 31
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
Does override
need to be overloaded explicitly?
#109
Comments
Not sure why, but F = TypeVar("F", bound=Callable)
override: Callable[[F], F] solves both issues: """Workaround."""
from typing import Callable, TypeVar
F = TypeVar("F", bound=Callable)
override: Callable[[F], F]
try:
from overrides import override
except ModuleNotFoundError:
def override(func: F) -> F:
return func
print(override) as well as """Workaround."""
from typing import Callable, TypeVar
F = TypeVar("F", bound=Callable)
overrides: Callable[[F], F]
try:
from overrides import overrides
except ModuleNotFoundError:
def overrides(func: F) -> F:
return func
print(overrides) |
Thanks @bersbersbers ! |
Fixed in 7.3.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mypy
treatsoverrides
andoverride
differently.(Note that I reported
no-redef
separately as python/mypy#13914. This issue is about themisc
mypy
message.)By contrast, this is fine:
I wonder if this is a
mypy
issue or whetheroverride
needs to be overloaded explicitly.The text was updated successfully, but these errors were encountered: