mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
_imp: fix stubtest issues, add Python 3.11 items (#7878)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import ReadableBuffer
|
||||
from importlib.machinery import ModuleSpec
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
check_hash_based_pycs: str
|
||||
def source_hash(key: int, source: ReadableBuffer) -> bytes: ...
|
||||
|
||||
def create_builtin(__spec: ModuleSpec) -> types.ModuleType: ...
|
||||
def create_dynamic(__spec: ModuleSpec, __file: Any = ...) -> types.ModuleType: ...
|
||||
@@ -12,10 +14,16 @@ def acquire_lock() -> None: ...
|
||||
def exec_builtin(__mod: types.ModuleType) -> int: ...
|
||||
def exec_dynamic(__mod: types.ModuleType) -> int: ...
|
||||
def extension_suffixes() -> list[str]: ...
|
||||
def get_frozen_object(__name: str) -> types.CodeType: ...
|
||||
def init_frozen(__name: str) -> types.ModuleType: ...
|
||||
def is_builtin(__name: str) -> int: ...
|
||||
def is_frozen(__name: str) -> bool: ...
|
||||
def is_frozen_package(__name: str) -> bool: ...
|
||||
def lock_held() -> bool: ...
|
||||
def release_lock() -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
def find_frozen(__name: str, *, withdata: bool = ...) -> tuple[memoryview | None, bool, str | None] | None: ...
|
||||
def get_frozen_object(__name: str, __data: ReadableBuffer | None = ...) -> types.CodeType: ...
|
||||
|
||||
else:
|
||||
def get_frozen_object(__name: str) -> types.CodeType: ...
|
||||
|
||||
@@ -81,7 +81,6 @@ _collections_abc.Iterable.__class_getitem__
|
||||
_collections_abc.MappingView.__class_getitem__
|
||||
_csv.Reader
|
||||
_csv.Writer
|
||||
_imp.source_hash
|
||||
asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this
|
||||
bdb.Breakpoint.clearBreakpoints
|
||||
distutils.dist.DistributionMetadata.set_classifiers
|
||||
|
||||
@@ -13,9 +13,6 @@ _collections_abc.MappingView.__class_getitem__
|
||||
_collections_abc.ValuesView.__reversed__
|
||||
_csv.Reader
|
||||
_csv.Writer
|
||||
_imp.find_frozen
|
||||
_imp.get_frozen_object
|
||||
_imp.source_hash
|
||||
_operator.attrgetter.__vectorcalloffset__
|
||||
_operator.itemgetter.__vectorcalloffset__
|
||||
argparse._AppendConstAction.__init__
|
||||
@@ -65,7 +62,6 @@ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolv
|
||||
ftplib.FTP.trust_server_pasv_ipv4_address
|
||||
functools.partial.__vectorcalloffset__
|
||||
gettext.install
|
||||
imp.get_frozen_object
|
||||
importlib.resources.Resource
|
||||
inspect._ParameterKind.description
|
||||
ipaddress.IPv4Interface.hostmask
|
||||
|
||||
@@ -89,7 +89,6 @@ tempfile.SpooledTemporaryFile.writable
|
||||
|
||||
# Exists at runtime, but missing from stubs
|
||||
_dummy_thread.RLock
|
||||
_imp.source_hash
|
||||
contextvars.ContextVar.__class_getitem__
|
||||
datetime.datetime_CAPI
|
||||
distutils.dist.DistributionMetadata.set_classifiers
|
||||
|
||||
@@ -105,7 +105,6 @@ tempfile.SpooledTemporaryFile.writable
|
||||
|
||||
# Exists at runtime, but missing from stubs
|
||||
_dummy_thread.RLock
|
||||
_imp.source_hash
|
||||
contextvars.ContextVar.__class_getitem__
|
||||
datetime.datetime_CAPI
|
||||
distutils.dist.DistributionMetadata.set_classifiers
|
||||
|
||||
@@ -109,7 +109,6 @@ _collections_abc.Awaitable.__class_getitem__
|
||||
_collections_abc.Container.__class_getitem__
|
||||
_collections_abc.Iterable.__class_getitem__
|
||||
_collections_abc.MappingView.__class_getitem__
|
||||
_imp.source_hash
|
||||
collections.AsyncIterable.__class_getitem__
|
||||
collections.Awaitable.__class_getitem__
|
||||
collections.Container.__class_getitem__
|
||||
|
||||
Reference in New Issue
Block a user