Skip to content

Conversation

@hauntsaninja
Copy link
Collaborator

No description provided.

@hauntsaninja
Copy link
Collaborator Author

Hmm, discovered python/mypy#5775

@hauntsaninja
Copy link
Collaborator Author

Also, the stubtest windows tests aren't doing anything (and I think this has been the case for a while, probably since they were moved to Github Actions)

@hauntsaninja hauntsaninja marked this pull request as ready for review August 15, 2020 21:22
class _PathLike(Generic[AnyStr]):
def __fspath__(self) -> AnyStr: ...
_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True)
class _PathLike(Protocol[_AnyStr_co]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put this in _typeshed?

Copy link
Collaborator Author

@hauntsaninja hauntsaninja Aug 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not to... even if it can be made to work, it'll involve a mypy-typeshed dance (and maybe changes to other type checkers) for little benefit.
Plus _typeshed is for making types internally reusable, and PathLike is already internally (and externally) reusable from os

@JelleZijlstra JelleZijlstra merged commit b438ccc into python:master Aug 16, 2020
@hauntsaninja hauntsaninja deleted the pat branch August 16, 2020 18:57
hauntsaninja pushed a commit to hauntsaninja/typeshed that referenced this pull request Sep 26, 2020
I made PathLike a protocol in python#4447, but it should also be
runtime_checkable.

Caught by mypy_primer:
src/werkzeug/utils.py:646: error: Only @runtime_checkable protocols can be used with instance and class checks
JelleZijlstra pushed a commit that referenced this pull request Sep 27, 2020
I made PathLike a protocol in #4447, but it should also be
runtime_checkable.

Caught by mypy_primer:
src/werkzeug/utils.py:646: error: Only @runtime_checkable protocols can be used with instance and class checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants