-
-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
Related to: python/cpython#106614 and #263
I see two possible workarounds for the mentioned issue:
str((files("jupyterlab_server.test_data") / "dummy").parent)or
str(files("jupyterlab_server.test_data")._paths[0])but both have issues with typing because the signature of files function is:
| def files(anchor: Optional[Anchor] = None) -> Traversable: |
In my specific case, files always returns
MultiplexedPath so both workarounds are fine but mypy complains about it because Traversable neither has _paths not parent attributes.
When I tried to change the return value in the annotation from Traversable to MultiplexedPath mypy did not complain about it so it seems that the function cannot return anything else than MultiplexedPath. Is that correct? Would it make sense to make the type annotation more specific?
Metadata
Metadata
Assignees
Labels
No labels