- cattrs version: 1.8.0
- Python version: 3.9.7
- Operating System: macOS
Description
Let's have the following test case
@define
class X(Generic[T]):
field: List[T]
def pred(cls):
print(f">>> {cls}")
return False
result = X[int]([1, 2, 3])
data = asdict(result)
c = GenConverter()
c.register_unstructure_hook_factory(pred, lambda cls: lambda obj: None)
c.unstructure(result, X[int])
assert c.structure(data, X[int]) == result
it passes, yet it prints
>>> tests.test_generics.test_karel.<locals>.X[int]
>>> typing.List[~T]
>>> ~T
Should it not be the case that the nested fields types (such as List[~T]) are provided with the type resolved, similarly to how the X[int] is provided in its most specific form?
Description
Let's have the following test case
it passes, yet it prints
Should it not be the case that the nested fields types (such as
List[~T]) are provided with the type resolved, similarly to how theX[int]is provided in its most specific form?