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 in Final, 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
Bug Report
According to the Python 3.13 ClassVar documentation,
ClassVarcan be nested withinFinal, andFinalcan likewise be nested withinClassVar.However, Mypy seems to type-check only the case where
ClassVaris nested insideFinal, not the reverse.To Reproduce
https://mypy-play.net/?mypy=latest&python=3.13&flags=strict&gist=996a968ac738badee42e71c23bd5f539
Expected Behavior
Actual Behavior
Your Environment
--strict