-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
Description
Bug Report
According to the Python 3.13 ClassVar documentation, ClassVar
can be nested within Final
, and Final
can likewise be nested within ClassVar
.
Changed in version 3.13:
ClassVar
can now be nested inFinal
, and vice versa.
However, Mypy seems to type-check only the case where ClassVar
is nested inside Final
, not the reverse.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.13&flags=strict&gist=996a968ac738badee42e71c23bd5f539
Expected Behavior
Success: no issues found in 1 source file
Actual Behavior
main.py:7: error: Returning Any from function declared to return "int" [no-any-return]
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: mypy 1.17.1 (compiled: yes)
- Mypy command-line flags:
--strict
- Python version used: Python 3.13.3
brianschubert