Closed dahlia closed 7 years ago
Python target generates code that raises NameError when a referring type is above than a referred type e.g.:
NameError
record a (b value); record b (text value);
The above code generates a Python code like the following (though it's approximated, it shows a point):
class A: __nirum_field_types__ = {'value': B} # B is not defined at the moment. class B: __nirum_field_types__ = {'value': str}
We need to encode all forward references as string literals and get types always through typing.get_type_hints() function.
typing.get_type_hints()
Python target generates code that raises
NameError
when a referring type is above than a referred type e.g.:The above code generates a Python code like the following (though it's approximated, it shows a point):