I have such code:
from inspect import signature
from typing import TypeVar, Generic
T = TypeVar('T', covariant=True)
class Plant():
def __init__(self, a, b) -> None:
super().__init__()
self.a = a
self.b = b
class Zomble(Generic[T]):
def __init__(self, a, b) -> None:
super().__init__()
self.a = a
self.b = b
cc = signature(Plant)
print(cc)
dd = signature(Zomble[int])
print(dd)
For cc, I get the output (a, b) -> None while dd get (*args, **kwargs) instead of the same of cc. What's the difference between the two classes? And is there any way to get the method parameters of classes inherit Generic?