When I use TypeVar with bounds in Pycharm, there are no hints related to the upper bound of the Typevar. Example:
from typing import TypeVar
class TestClass:
def test_class_method(self):
print("test")
T = TypeVar('T', bound=TestClass)
def test_method(test_class: T):
test_class.test_class_method()
test_method(TestClass())
Here, I would expect the test_class method to be listed in autocomplete when I hit ctrl + space on test_class. But there is nothing. When I highlight the test_class, there is a tooltip saying correctly: Inferred type: TypeVar('T', TestClass). Is there a mistake on my side, or is it a autocomplete issue?