inspect: getmodulename takes a PathLike as well as str (#10329)

Fixes #10328
This commit is contained in:
Shantanu
2023-06-18 13:19:57 -07:00
committed by GitHub
parent df795220a3
commit 7114aecf77

View File

@@ -2,6 +2,7 @@ import dis
import enum
import sys
import types
from _typeshed import StrPath
from collections import OrderedDict
from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine, Generator, Mapping, Sequence, Set as AbstractSet
from types import (
@@ -177,7 +178,7 @@ if sys.version_info >= (3, 11):
@overload
def getmembers_static(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn: ...
def getmodulename(path: str) -> str | None: ...
def getmodulename(path: StrPath) -> str | None: ...
def ismodule(object: object) -> TypeGuard[ModuleType]: ...
def isclass(object: object) -> TypeGuard[type[Any]]: ...
def ismethod(object: object) -> TypeGuard[MethodType]: ...