mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 18:31:14 +08:00
inspect: getmodulename takes a PathLike as well as str (#10329)
Fixes #10328
This commit is contained in:
@@ -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]: ...
|
||||
|
||||
Reference in New Issue
Block a user