Replies: 2 comments
-
|
Hey @phalberg, I looked into this and traced it through PR #1546. Originally, At some point after #1546, Your Option 2 seems like the right direction: adjusting I'd lean against just deleting If it's helpful, I'd be glad to propose a PR for this fix. |
Beta Was this translation helpful? Give feedback.
-
|
Quick update - while checking into this issue as mentioned, and testing it on my local machine, I came across @svlandeg's comment in #1855 about an active refactor of type resolution happening in Typer right now. Since this touches type annotations in the same test file, just wanted to mention it in case it's relevant timing-wise before this goes any further. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
Hello,
I read trough some of the code for typer, namely more concretely in
tests/test_type_conversion.pywhere it seems to start with this [see above for the code] which are currently identical test with different names. I did some digging and when support was dropped for python 3.9, the conversion:Optional[str]might have resulted instr | None, see #1546, by the help of some tool like ruff or something.Before opening a PR I wanted to make sure I am aligned, as I see it there are two options:
test_optional()as it is no longer needed or,test_optional()to usedef opt(user: Optional[str] = None):(and import it)I would think reverting back to
Optionalis perhaps not the preferred option, but it is still widely used, so just making sure!Operating System
Windows
Operating System Details
No response
Project Version
v.0.26.7
Python Version
3.10.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions