We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
To Reproduce
from typing import ( Generic, Hashable, Sequence, TypeVar, ) T = TypeVar("T") class Series(Generic[T]): def reset_index(self, level: Sequence | Hashable = ...): ... Series().reset_index(["ab"]) # fails reveal_type( Series().reset_index ) # Revealed type is "def (level: typing.Hashable =) -> Any" class Series2: # not generic def reset_index(self, level: Sequence | Hashable = ...): ... Series2().reset_index(["ab"]) # works reveal_type( Series2().reset_index ) # Revealed type is "def (level: Union[typing.Sequence[Any], typing.Hashable] =) -> Any"```
Expected Behavior
Series().reset_index(["ab"]) is accepted since list[str] is a Sequence.
Series().reset_index(["ab"])
list[str]
Sequence
Actual Behavior
Sequence | Hashable is reduced to just Hashable which is incompatible with list[str].
Sequence | Hashable
Hashable
Your Environment
The text was updated successfully, but these errors were encountered:
This appears to have been fixed in mypy 1.0.0.
Sorry, something went wrong.
Fixed in #14178
No branches or pull requests
Bug Report
To Reproduce
Expected Behavior
Series().reset_index(["ab"])
is accepted sincelist[str]
is aSequence
.Actual Behavior
Sequence | Hashable
is reduced to justHashable
which is incompatible withlist[str]
.Your Environment
The text was updated successfully, but these errors were encountered: