How to model complex variable in Python

On this page there is a section on defining complex input variables but the examples exclude Python, is there a reason for this? Is it no possible with Python or does someone have any tips/examples of maybe more complex variables like type=list(object(…)) or similar?

When I try to use list[dict[str,str]] for example I get AttributeError: type object 'set' has no attribute '__jsii_type__'

Hi @mpicard :wave:

That’s an oversight on our end and there’s an open issue to translate that example to other languages as well. It should work for Python, too.

Could you share more context of what you are trying to achieve? Where are you passing list[dict[str,str]]? Some of the surrounding code might help me to understand where exactly you are stuck.

– Ansgar

Thanks for showing me the issue, will follow.

I solved the issue, I did have a type mismatch and it’s now correctly list[dict[str,str]]