I'm trying to have an iterable of TextXClass
instances for the implementation part of my meta-model but since that class is created dynamically, I'm out of luck. Is there still some clever way to type the individual elements of my model or will I have to essentially go with Iterable[Any]
?
Python Typing: How to Reference Dynamically Created Class in Type Hints
187 views Asked by Christian At
1
You can simply create the class dynamically, and forward reference it, by setting it in quotes. The link sais:
A minimal example: