mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[stdlib] add importlib.util._incompatible_extension_module_restrictions (#15013)
This commit is contained in:
@@ -12,7 +12,9 @@ from importlib._bootstrap_external import (
|
||||
spec_from_file_location as spec_from_file_location,
|
||||
)
|
||||
from importlib.abc import Loader
|
||||
from typing_extensions import ParamSpec, deprecated
|
||||
from types import TracebackType
|
||||
from typing import Literal
|
||||
from typing_extensions import ParamSpec, Self, deprecated
|
||||
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
@@ -44,6 +46,18 @@ class LazyLoader(Loader):
|
||||
|
||||
def source_hash(source_bytes: ReadableBuffer) -> bytes: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
class _incompatible_extension_module_restrictions:
|
||||
def __init__(self, *, disable_check: bool) -> None: ...
|
||||
disable_check: bool
|
||||
old: Literal[-1, 0, 1] # exists only while entered
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
@property
|
||||
def override(self) -> Literal[-1, 1]: ... # undocumented
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
__all__ = [
|
||||
"LazyLoader",
|
||||
|
||||
Reference in New Issue
Block a user