Closed
Description
The following code:
class A:
class B[T]:
def f(self) -> T: ...
produces the following output:
$ mypy --enable-incomplete-feature=NewGenericSyntax test.pyi
test.pyi: note: In member "f" of class "B":
test.pyi:3:24: error: A function returning TypeVar should receive at least one argument containing the same TypeVar [type-var]
def f(self) -> T: ...
^
Found 1 error in 1 file (checked 1 source file)
This looks like a false positive to me.
$ mypy --version
mypy 1.11.0 (compiled: yes)
$ python3 --version
Python 3.12.3
$ lsb_release -d
No LSB modules are available.
Description: Ubuntu 24.04 LTS