-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typing error #1359
Fix typing error #1359
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1359 +/- ##
==========================================
- Coverage 89.14% 89.13% -0.02%
==========================================
Files 75 75
Lines 10266 10265 -1
==========================================
- Hits 9152 9150 -2
- Misses 1114 1115 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -44,7 +44,7 @@ | |||
@devel_debug_option() | |||
@map_to_click_exceptions | |||
def move( | |||
paths: tuple[str], | |||
paths: tuple[str, ...], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my own sake, so the old one is a tuple of a single str
and new one is tuple of strings or tuple with the first element a str
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tuple[str]
is a tuple of length 1 containing a str
. tuple[str, ...]
is a tuple of any length where all elements are str
s.
Mypy was complaining because we we doing this inside the function:
dandi-cli/dandi/cli/cmd_move.py
Lines 88 to 89 in cb86c9c
if len(paths) < 2: | |
raise ValueError("At least two paths are required") |
and len()
of a one-element tuple is always less than 2, making the line after the raise
unreachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it is the
dandi/cli/cmd_move.py:90: error: Statement is unreachable [unreachable]
move_mod.move(
^
Found 1 error in 1 file (checked 77 source files)
one. got it. thank you for the explanation
🚀 PR was released in |
I suspect the error in question only started being emitted when mypy 1.7.0 was released on the 10th.