importlib.abc: align input data types in InspectLoader.source_to_code builtin.compile inputs (#9852)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2023-03-08 14:43:05 +01:00
committed by GitHub
parent 28b90d9bfd
commit c661ac3ad6

View File

@@ -1,3 +1,4 @@
import _ast
import sys
import types
from _typeshed import (
@@ -7,6 +8,7 @@ from _typeshed import (
OpenBinaryModeWriting,
OpenTextMode,
ReadableBuffer,
StrPath,
)
from abc import ABCMeta, abstractmethod
from collections.abc import Iterator, Mapping, Sequence
@@ -52,7 +54,9 @@ class InspectLoader(Loader):
def get_source(self, fullname: str) -> str | None: ...
def exec_module(self, module: types.ModuleType) -> None: ...
@staticmethod
def source_to_code(data: ReadableBuffer | str, path: str = "<string>") -> types.CodeType: ...
def source_to_code(
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: ReadableBuffer | StrPath = "<string>"
) -> types.CodeType: ...
class ExecutionLoader(InspectLoader):
@abstractmethod