Closed YooSunYoung closed 1 month ago
The error message shows that something odd is going on: Why is it looking for typing.Optional[__main__.OptionalInt]
and not __main__.OptionalInt
?
This is because of how get_type_hints
worked prior to python 3.11.
Changed in version 3.11: Previously, Optional[t] was added for function and method annotations if a default value equal to None was set. Now the annotation is returned unchanged.
I've verified that the bug is not present when this is run in 3.11.
What's best to do? Should we
Edit: decided to fix it
do nothing ;)
Just wait it out? https://scientific-python.org/specs/spec-0000/#support-window Python 3.10 could be dropped in a bit :)
Just wait it out? https://scientific-python.org/specs/spec-0000/#support-window Python 3.10 could be dropped in a bit :)
3.10 already out? Looking at that schedule makes me feel old. But yeah this could well be the best option
The proposed fix was insufficient so it was decided to do nothing instead.
For essimaging I wanted to make some arguments optional,
But if the argument has a default value of None, it fails.
Is it a known limitation or a bug...?