Serializer understand `Optional[...]`, but not `...|None`
Opened this issue · 0 comments
Carreau commented
Not critical if we use Optional[...]
in the code base but it would be nice to support.
In [1]: from papyri.gen import Node
...: from typing import Optional
...: class Foo(Node):
...: a : Optional[int]
...: b : int | None
...: Foo(1, 2).to_dict()
Out[1]: {'type': 'Foo', 'a': 1, 'b': None}
# ^ should be 2