Add __all__ for modules beginning with 'c' and 'd' (#7303)

This commit is contained in:
Alex Waygood
2022-02-20 01:51:27 +00:00
committed by GitHub
parent ebdbd564be
commit e9db3bd50a
8 changed files with 116 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
from typing import Any, TypeVar
__all__ = ["Error", "copy", "deepcopy"]
_T = TypeVar("_T")
# None in CPython but non-None in Jython

View File

@@ -26,6 +26,30 @@ if sys.version_info >= (3, 8):
else:
from collections import OrderedDict as _DictReadMapping
__all__ = [
"QUOTE_MINIMAL",
"QUOTE_ALL",
"QUOTE_NONNUMERIC",
"QUOTE_NONE",
"Error",
"Dialect",
"__doc__",
"excel",
"excel_tab",
"field_size_limit",
"reader",
"writer",
"register_dialect",
"get_dialect",
"list_dialects",
"Sniffer",
"unregister_dialect",
"__version__",
"DictReader",
"DictWriter",
"unix_dialect",
]
_T = TypeVar("_T")
class excel(Dialect):

View File

@@ -11,6 +11,38 @@ if sys.version_info >= (3, 9):
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
if sys.version_info >= (3, 10):
__all__ = [
"dataclass",
"field",
"Field",
"FrozenInstanceError",
"InitVar",
"KW_ONLY",
"MISSING",
"fields",
"asdict",
"astuple",
"make_dataclass",
"replace",
"is_dataclass",
]
else:
__all__ = [
"dataclass",
"field",
"Field",
"FrozenInstanceError",
"InitVar",
"MISSING",
"fields",
"asdict",
"astuple",
"make_dataclass",
"replace",
"is_dataclass",
]
# define _MISSING_TYPE as an enum within the type stubs,
# even though that is not really its type at runtime
# this allows us to use Literal[_MISSING_TYPE.MISSING]

View File

@@ -4,6 +4,9 @@ from time import struct_time
from typing import ClassVar, NamedTuple, NoReturn, SupportsAbs, TypeVar, overload
from typing_extensions import Literal, final
if sys.version_info >= (3, 9):
__all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR")
_D = TypeVar("_D", bound=date)
MINYEAR: Literal[1]

View File

@@ -3,6 +3,8 @@ from types import TracebackType
from typing import Iterator, MutableMapping, Union
from typing_extensions import Literal
__all__ = ["open", "whichdb", "error"]
_KeyType = Union[str, bytes]
_ValueType = Union[str, bytes]
_TFlags = Literal[

View File

@@ -2,6 +2,8 @@ from _typeshed import Self
from types import TracebackType
from typing import Iterator, MutableMapping, Union
__all__ = ["error", "open"]
_KeyType = Union[str, bytes]
_ValueType = Union[str, bytes]

View File

@@ -4,6 +4,21 @@ from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTupl
if sys.version_info >= (3, 9):
from types import GenericAlias
__all__ = [
"get_close_matches",
"ndiff",
"restore",
"SequenceMatcher",
"Differ",
"IS_CHARACTER_JUNK",
"IS_LINE_JUNK",
"context_diff",
"unified_diff",
"diff_bytes",
"HtmlDiff",
"Match",
]
_T = TypeVar("_T")
class Match(NamedTuple):

View File

@@ -2,6 +2,42 @@ import types
import unittest
from typing import Any, Callable, NamedTuple
__all__ = [
"register_optionflag",
"DONT_ACCEPT_TRUE_FOR_1",
"DONT_ACCEPT_BLANKLINE",
"NORMALIZE_WHITESPACE",
"ELLIPSIS",
"SKIP",
"IGNORE_EXCEPTION_DETAIL",
"COMPARISON_FLAGS",
"REPORT_UDIFF",
"REPORT_CDIFF",
"REPORT_NDIFF",
"REPORT_ONLY_FIRST_FAILURE",
"REPORTING_FLAGS",
"FAIL_FAST",
"Example",
"DocTest",
"DocTestParser",
"DocTestFinder",
"DocTestRunner",
"OutputChecker",
"DocTestFailure",
"UnexpectedException",
"DebugRunner",
"testmod",
"testfile",
"run_docstring_examples",
"DocTestSuite",
"DocFileSuite",
"set_unittest_reportflags",
"script_from_examples",
"testsource",
"debug_src",
"debug",
]
class TestResults(NamedTuple):
failed: int
attempted: int