mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-05 09:27:38 +08:00
Add __all__ for modules beginning with 'h' and 'i' (#7327)
This commit is contained in:
@@ -2,6 +2,8 @@ from importlib.abc import Loader
|
||||
from types import ModuleType
|
||||
from typing import Mapping, Sequence
|
||||
|
||||
__all__ = ["__import__", "import_module", "invalidate_caches", "reload"]
|
||||
|
||||
# Signature of `builtins.__import__` should be kept identical to `importlib.__import__`
|
||||
def __import__(
|
||||
name: str,
|
||||
|
||||
@@ -5,6 +5,38 @@ from pathlib import Path
|
||||
from types import ModuleType
|
||||
from typing import Any, BinaryIO, Iterator, TextIO, Union
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ = [
|
||||
"Package",
|
||||
"Resource",
|
||||
"ResourceReader",
|
||||
"as_file",
|
||||
"contents",
|
||||
"files",
|
||||
"is_resource",
|
||||
"open_binary",
|
||||
"open_text",
|
||||
"path",
|
||||
"read_binary",
|
||||
"read_text",
|
||||
]
|
||||
elif sys.version_info >= (3, 9):
|
||||
__all__ = [
|
||||
"Package",
|
||||
"Resource",
|
||||
"as_file",
|
||||
"contents",
|
||||
"files",
|
||||
"is_resource",
|
||||
"open_binary",
|
||||
"open_text",
|
||||
"path",
|
||||
"read_binary",
|
||||
"read_text",
|
||||
]
|
||||
else:
|
||||
__all__ = ["Package", "Resource", "contents", "is_resource", "open_binary", "open_text", "path", "read_binary", "read_text"]
|
||||
|
||||
Package = Union[str, ModuleType]
|
||||
Resource = Union[str, os.PathLike[Any]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user