-
-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the bug
PlutusData
classes honor old type hints (e.g. List[bytes]
) by using issubclass
.
Modern type hints (e.g. list[bytes]
) fail because list
is not a class.
This is the guilty line of code:
Line 533 in fdff5f2
if inspect.isclass(f.type) and not issubclass(f.type, valid_types): |
To Reproduce
Create a PlutusData
class with modern type hints and try to instantiate.
from pycardano import PlutusData
class Test(PlutusData):
a: list[bytes]
Test(a=[b'hello', b'world'])
Environment and software version (please complete the following information):
- PyCardano Version 0.10.0
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request