Repository navigation
fix: issue #216 - #217
fix: issue #216#217thorwhalen wants to merge 1 commit into
Conversation
Replaced ```python if args and (args[0] in cls.BASIC_TYPES): ``` with ```python if args and (args[0] in cls.BASIC_TYPES): ```
|
Hi @thorwhalen, thank you for the report and the fix! Could you please provide a minimal example to repro the bug? It would be great to update the unit tests along with the fix. |
from typing import Optional, List
def func(x: Optional[List] = None):
return 'hello'
if __name__ == '__main__':
import argh
argh.dispatch_command(func) |
Given this, perhaps my PR is not the right fix. Perhaps it's something to do with Note: I'm on python 3.10.13, on a mac. |
|
Aha, thanks, got it! P.S.: if you don't need to support older Pythons, you can simply replace List with |
|
Thank you Thor, the final fix was indeed a bit different (see 8f270d0) but your effort and your example have helped me pinpoint the exact problem and solve it there. Will ship the fix in 0.31.1 today. |
|
Great. Thanks. I'll update to 0.31.1 now. |
Replaced
with