from pathlib import Path
from urlpath import URL
def do_something(path: Path, url: URL) -> str:
return url / path
do_something(Path('file.ext'), URL('example.com')) # ok
do_something('file.ext', URL('example.com')) # error
do_something(Path('file.ext'), 'example.com') # ok ?!?
reveal_type(Path('file.ext')) # Revealed type is pathlib.Path
reveal_type(URL('example.com')) # Revealed type is "Any" ?!?
Any idea why this is? I just found this library today, already use pathlib a lot in my project and really like the look of this, but this behaviour is wierd and makes it less usable in a type hinted enviroment.