Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
Commite133018
committed
Broaden cygpath parameter annotation
To fix a mypy error in Repo.__init__ where the epath variable,which can sometimes be a os.PathLike[str], does not match the strannotation for cygpath's path parameter, even though cygwinimmediately calls str on that parameter.Pulling most of cygpath out into a new helper function is to helpmypy correctly infer that the type of path is still compatible withthe return type of str, when it is used in the return statement.I'm not sure this change is really the best solution at this time,because while it fixes the mypy error (without creating a new one),and cygpath is not listed in __all__, the docstring of advises tocall Git.polish_url instead of cygpath. That method is public,annotates its parameter as str, and should not have its annotationbroadened without considernig if it makes sense to do so or if itsdocstring needs to be updated.So either the cygpath docstring should be updated or this changeshould be undone and a different approach used to fix the typeerror in Repo.__init__.1 parentf1cc1fe commite133018
1 file changed
+6
-3
lines changedLines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
404 | 404 |
| |
405 | 405 |
| |
406 | 406 |
| |
407 |
| - | |
408 |
| - | |
409 |
| - | |
| 407 | + | |
410 | 408 |
| |
411 | 409 |
| |
412 | 410 |
| |
| |||
422 | 420 |
| |
423 | 421 |
| |
424 | 422 |
| |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
425 | 428 |
| |
426 | 429 |
| |
427 | 430 |
| |
|
0 commit comments
Comments
(0)