mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 22:56:55 +08:00
Simplify __all__ definitions in modules beginning with 'a' to 'l' (#8026)
This commit is contained in:
@@ -9,34 +9,21 @@ from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Any, ClassVar, NamedTuple, Pattern, overload
|
||||
|
||||
__all__ = [
|
||||
"Distribution",
|
||||
"DistributionFinder",
|
||||
"PackageNotFoundError",
|
||||
"distribution",
|
||||
"distributions",
|
||||
"entry_points",
|
||||
"files",
|
||||
"metadata",
|
||||
"requires",
|
||||
"version",
|
||||
]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ = [
|
||||
"Distribution",
|
||||
"DistributionFinder",
|
||||
"PackageMetadata",
|
||||
"PackageNotFoundError",
|
||||
"distribution",
|
||||
"distributions",
|
||||
"entry_points",
|
||||
"files",
|
||||
"metadata",
|
||||
"packages_distributions",
|
||||
"requires",
|
||||
"version",
|
||||
]
|
||||
else:
|
||||
__all__ = [
|
||||
"Distribution",
|
||||
"DistributionFinder",
|
||||
"PackageNotFoundError",
|
||||
"distribution",
|
||||
"distributions",
|
||||
"entry_points",
|
||||
"files",
|
||||
"metadata",
|
||||
"requires",
|
||||
"version",
|
||||
]
|
||||
__all__ += ["PackageMetadata", "packages_distributions"]
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
from importlib.metadata._meta import PackageMetadata as PackageMetadata
|
||||
|
||||
@@ -7,37 +7,13 @@ from types import ModuleType
|
||||
from typing import Any, BinaryIO, TextIO
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = ["Package", "Resource", "contents", "is_resource", "open_binary", "open_text", "path", "read_binary", "read_text"]
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
__all__ += ["as_file", "files"]
|
||||
|
||||
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"]
|
||||
__all__ += ["ResourceReader"]
|
||||
|
||||
Package: TypeAlias = str | ModuleType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user