First Check
Commit to Help
Example Code
from pathlib import Path
import typer
def main(output: Path | None):
typer.guess_name(f"Hello {name}")
if __name__ == "__main__":
typer.run(main)
Description
Using an argument with the type of pathlib.Path | None (as per PEP 604) raise the error:
Type not yet supported: pathlib.Path | None
Wanted Solution
| None types should work instead of having to need to use Optional[].
Wanted Code
from pathlib import Path
import typer
def main(output: Path | None):
typer.echo(output)
if __name__ == "__main__":
typer.run(main)
Alternatives
No response
Operating System
Linux
Operating System Details
No response
Typer Version
0.4.0
Python Version
3.10.1
Additional Context
No response
First Check
Commit to Help
Example Code
Description
Using an argument with the type of
pathlib.Path | None(as per PEP 604) raise the error:Wanted Solution
| Nonetypes should work instead of having to need to useOptional[].Wanted Code
Alternatives
No response
Operating System
Linux
Operating System Details
No response
Typer Version
0.4.0
Python Version
3.10.1
Additional Context
No response