[issue37920] Support subscripting os.PathLike and make it valid at runtime
Cameron Trando added the comment: What happened is that we have a hard time analyzing PathLike because in the pathlib stub they use PathLike[str], so when we try to analyze Path which inherits from PathLike[str], because PathLike is not generic, then we think it's an instance of an object and don't inherit from it. That means Path has incorrect bases. Previously we assumed we only had to special case typing so we will special case PathLike as well. -- ___ Python tracker <https://bugs.python.org/issue37920> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37920] Support subscripting os.PathLike and make it valid at runtime
New submission from Cameron Trando : Currently os.PathLike[str] causes a runtime error; however, typeshed sees it as valid and mypy does not throw any errors on it. mypy treats it as os.PathLike[AnyStr] I already filed a bug on typeshed, see https://github.com/python/typeshed/issues/3202 And since mypy interprets it as useful, cpython should try and support it as well. -- messages: 350221 nosy: Cameron Trando priority: normal severity: normal status: open title: Support subscripting os.PathLike and make it valid at runtime type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue37920> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com