Skip to content
16 changes: 15 additions & 1 deletion stdlib/importlib/util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
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")

Expand Down Expand Up @@ -44,6 +46,18 @@

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

Check failure on line 52 in stdlib/importlib/util.pyi

View workflow job for this annotation

GitHub Actions / pyright: Run test cases (Linux, 3.13)

Unexpected indentation
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",
Expand Down
Loading