You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code above should work with the commented section uncommented. Currently, if it is uncommented and run, it will raise:
RuntimeError: Type not yet supported: typing.Set[str]
Wanted Solution
Similar to how Typer supports using typing.List to accept a CLI parameter as a list of some supported atomic type (e.g. str, int, float, etc.), it should also support using typing.Set. It would be as if the parameter used typing.List, but then before returning the list to the command function, set is called on it. This provides some advantages, such as:
removing duplicates
removing argument order information
providing a data structure with fast inclusion checking
First Check
Commit to Help
Example Code
Description
The code above should work with the commented section uncommented. Currently, if it is uncommented and run, it will raise:
Wanted Solution
Similar to how
Typer
supports usingtyping.List
to accept a CLI parameter as a list of some supported atomic type (e.g.str
,int
,float
, etc.), it should also support usingtyping.Set
. It would be as if the parameter usedtyping.List
, but then before returning the list to the command function,set
is called on it. This provides some advantages, such as:Wanted Code
Alternatives
No response
Operating System
Linux, Windows, macOS
Operating System Details
No response
Typer Version
0.6.1
Python Version
3.7.9
Additional Context
I would like to implement this feature myself.
The text was updated successfully, but these errors were encountered: