Open rouge8 opened 1 year ago
Ahh I see, reading the docstring it's the typehint that is wrong. Will fix.
Hmm, so the way I see to fix this would be to use a typing.Protocol
with a __str__
method, but it looks like invoke supports Python 3.6 which doesn't have that and doesn't currently have a dependency on typing_extensions
. Should I add a dependency on typing_extensions
to the dev requirements?
All objects have __str__
so a protocol for __str__
doesn't make sense. If you only want to support objects that are actually meant to be paths, os.fspath
is a better choice.
I should have checked typeshed. I knew there were types for paramiko but no idea one was created for invoke. I'll see what I can reuse here.
Thanks for the assist!
__fspath__
instead of __str__
for the tests to pass.
Issue found when fixing the type hint in typeshed: https://github.com/python/typeshed/pull/9823#pullrequestreview-1316129640