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:
|
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):
Describe the bug
PlutusDataclasses honor old type hints (e.g.List[bytes]) by usingissubclass.Modern type hints (e.g.
list[bytes]) fail becauselistis not a class.This is the guilty line of code:
pycardano/pycardano/plutus.py
Line 533 in fdff5f2
To Reproduce
Create a
PlutusDataclass with modern type hints and try to instantiate.Environment and software version (please complete the following information):