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
If this really is considered an error, it would be great to have a bit more detail here about what's gone wrong and why it's a problem.
I'm guessing that catching this and telling the user that they're likely got a type annotation outside a typing context could be useful, however it feels like type aliases (Foo = tuple[int, ...]) might be broken by the current behaviour.
In my case we hit this while partially upgrading an old function-style NamedTuple declaration (to use tuple but not class-style NamedTuple), where the error was particularly confusing as Tuple[int, ...] had worked fine.
Your Environment
Mypy version used: 0.910
Mypy command-line flags: none
Mypy configuration options from mypy.ini (and other config files): none
Python version used: 3.9
Operating system and version: Ubuntu 20.04
The text was updated successfully, but these errors were encountered:
Bug Report
Given
tuple[str, ...]
outside a typing context mypy produces an error which doesn't seem very clear:Python is quite happy with the code however:
Expected Behavior
If this really is considered an error, it would be great to have a bit more detail here about what's gone wrong and why it's a problem.
I'm guessing that catching this and telling the user that they're likely got a type annotation outside a typing context could be useful, however it feels like type aliases (
Foo = tuple[int, ...]
) might be broken by the current behaviour.In my case we hit this while partially upgrading an old function-style
NamedTuple
declaration (to usetuple
but not class-styleNamedTuple
), where the error was particularly confusing asTuple[int, ...]
had worked fine.Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: