Skip to content

Change some os.path stubs to acknowledge __fspath__ protocol support in >=Python3.6 #1997

Closed
@brycepg

Description

@brycepg

Example:

from pathlib import Path
import os
os.path.join(Path("."), '..')

Is valid python because Python3.6 os.path has been changed to accept the __fspath__ protocol
However mypy outputs:

t.py:3: error: Value of type variable "AnyStr" of "join" cannot be "object"

Relevant location: https://github.com/python/typeshed/blob/master/stdlib/3/os/path.pyi#L79

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions