You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know in what version of Python this started, but importlib.util.spec_from_file_location accepts a pathlib.Path as the second argument, not just a str as mypy 0.701 seems to believe. Probably a quick fix for someone who knows the codebase better.
@srittau If you can point me to the source file where spec_from_file_location is typed, and to the preferred PathLike or whatever type we need, I'll happily make the pull request.
Activity
srittau commentedon Jun 12, 2019
Added in 3.6 according to the docs. Patches welcome!
thejohnfreeman commentedon Jun 12, 2019
@srittau If you can point me to the source file where
spec_from_file_locationis typed, and to the preferredPathLikeor whatever type we need, I'll happily make the pull request.srittau commentedon Jun 12, 2019
@thejohnfreeman
spec_from_file_locationis typed in master/stdlib/3/importlib/util.pyi. An example of how to type something like this, including the necessary version check can be found here.Add missing path-like annotation (#3053)