Open mccalluc opened 7 months ago
I'm trying to expand the docs on context.py. Added a doctest:
context.py
>>> domain_of(Optional[int])
It fails. I believe the problem is in typing.py:
typing.py
if hinted_type: origin, args = hinted_type args = [RuntimeType.parse(v, generics=generics) for v in args] or None # type: ignore[assignment] if origin == tuple: origin = 'Tuple' elif origin == list: origin = 'Vec' elif origin == dict: origin = 'HashMap'
Optional is actually a shortcut for Union with None, and we have nothing that handles that.
Optional
Union
None
Rust string does work.
When this is fixed, remember to add a test to test_typing_hint.
test_typing_hint
Note: low priority. May change with Polars
I'm trying to expand the docs on
context.py
. Added a doctest:It fails. I believe the problem is in
typing.py
:Optional
is actually a shortcut forUnion
withNone
, and we have nothing that handles that.Rust string does work.
When this is fixed, remember to add a test to
test_typing_hint
.