atdpy treats the option type as nullable but it should not.
The convention used by ATD is to use "None" or ["Some", 42] to represent int option values in JSON. Python code generated by atdpy instead expects null or 42 as if the type was int nullable rather than int option.
I don't think we need to support the option type at all for Python since Python doesn't have a standard option type. The Optional type known by mypy is in fact equivalent to ATD's nullable, not option.
Instead of emitting an error, we could create an option type for Python but it would probably be awkward. This can be done later if there's some demand for it (I doubt it will be the case).
atdpy treats the
option
type asnullable
but it should not.The convention used by ATD is to use
"None"
or["Some", 42]
to representint option
values in JSON. Python code generated by atdpy instead expectsnull
or42
as if the type wasint nullable
rather thanint option
.I don't think we need to support the
option
type at all for Python since Python doesn't have a standard option type. TheOptional
type known by mypy is in fact equivalent to ATD'snullable
, notoption
.Instead of emitting an error, we could create an option type for Python but it would probably be awkward. This can be done later if there's some demand for it (I doubt it will be the case).