-
-
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
@overload - mypy thinks function signatures overlap #8656
Comments
I think the issue is that eg, it's unclear what type |
If you find the docs unclear, how would you feel about:
People often tend to run into this when literal types are in the mix, so might be worth calling that out too. Can also try stealing language from the docstrings for |
@hauntsaninja Apologies, after realizing my mistake I deleted my post and opened issue #9451 |
Took another look at the original example and read some code and I'm not so sure of anything anymore :-) So here, this issue is open again. Line 339 in b707d29
|
Sorry Glyph, I could not get overload to work for callRemoteString. I hit this issue: python/mypy#8656
Sorry Glyph, I could not get overload to work for callRemoteString. I hit this issue: python/mypy#8656
I think this is reporting as designed. |
I think there are two documentation issues here:
|
A new error code was introduced in #16061 As per #16068, we didn't previously run doc builds on changes to errorcodes.py, causing tests to fail on master when this was merged. Renaming the code as per: #16061 (comment) All type ignores should be unsafe, so we should save the unsafe adjective for things that are really unsafe. As it stands, there are many cases where overloads overlap somewhat benignly. Fixes #8656
Hello,
I'm in the middle of introducing mypy to a medium-size codebase. Here's a simplified overload situation:
Mypy claims:
error: Overloaded function signatures 1 and 2 overlap with incompatible return types
The docs state: Two variants are considered unsafely overlapping when both of the following are true:
But this doesn't seem to be the case.
List[Dict]
is not compatible withList[Optional[Dict]]
, no?Mypy 0.770, Python 3.8.0.
The text was updated successfully, but these errors were encountered: