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
Run it with Python 3.8 or later and it runs fine (I don't have Python 3.7 due to ARM).
Check it with mypy and it fails:
draft $ mypy mod.py
mod.py:4: error: Argument 1 to "getmodulename" has incompatible type "PurePosixPath"; expected "str" [arg-type]
Found 1 error in 1 file (checked 1 source file)
Indeed the definition indicates that only str is allowed for input.
The implementation passes the input through to os.path.basename, which accepts pathlib.Path. Probably the typeshed should reflect this behavior, especially considering that the docs suggest that the input is a "path".
Activity
inspect: getmodulename takes a PathLike
inspect: getmodulename takes a PathLike as well as str (#10329)
Remove workaround for python/typeshed#10328.
pypi-importlib_metadata: Autospec creation for update from version 8.…