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
To fix a mypy error in Repo.__init__ where the epath variable,
which can sometimes be a os.PathLike[str], does not match the str
annotation for cygpath's path parameter, even though cygwin
immediately calls str on that parameter.
Pulling most of cygpath out into a new helper function is to help
mypy correctly infer that the type of path is still compatible with
the 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 to
call Git.polish_url instead of cygpath. That method is public,
annotates its parameter as str, and should not have its annotation
broadened without considernig if it makes sense to do so or if its
docstring needs to be updated.
So either the cygpath docstring should be updated or this change
should be undone and a different approach used to fix the type
error in Repo.__init__.
0 commit comments