Add __all__ to modules beginning with 'j', 'k' and 'l' (#7328)

This commit is contained in:
Alex Waygood
2022-02-20 23:06:54 +00:00
committed by GitHub
parent 07de01f29e
commit 3ead05f277
9 changed files with 273 additions and 1 deletions

View File

@@ -4,6 +4,8 @@ from typing import IO, Any, Callable
from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder
from .encoder import JSONEncoder as JSONEncoder
__all__ = ["dump", "dumps", "load", "loads", "JSONDecoder", "JSONDecodeError", "JSONEncoder"]
def dumps(
obj: Any,
*,

View File

@@ -1,5 +1,7 @@
from typing import Any, Callable
__all__ = ["JSONDecoder", "JSONDecodeError"]
class JSONDecodeError(ValueError):
msg: str
doc: str

View File

@@ -1,6 +1,11 @@
import sys
from typing import Sequence
if sys.version_info >= (3, 9):
__all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"]
else:
__all__ = ["iskeyword", "kwlist"]
def iskeyword(s: str) -> bool: ...
kwlist: Sequence[str]

View File

@@ -4,6 +4,8 @@ from lib2to3.pytree import _NL, _Convert
from logging import Logger
from typing import IO, Any, Iterable
__all__ = ["Driver", "load_grammar"]
class Driver:
grammar: Grammar
logger: Logger

View File

@@ -1,6 +1,151 @@
from lib2to3.pgen2.token import * # noqa
import sys
from lib2to3.pgen2.token import *
from typing import Callable, Iterable, Iterator
if sys.version_info >= (3, 8):
__all__ = [
"AMPER",
"AMPEREQUAL",
"ASYNC",
"AT",
"ATEQUAL",
"AWAIT",
"BACKQUOTE",
"CIRCUMFLEX",
"CIRCUMFLEXEQUAL",
"COLON",
"COLONEQUAL",
"COMMA",
"COMMENT",
"DEDENT",
"DOT",
"DOUBLESLASH",
"DOUBLESLASHEQUAL",
"DOUBLESTAR",
"DOUBLESTAREQUAL",
"ENDMARKER",
"EQEQUAL",
"EQUAL",
"ERRORTOKEN",
"GREATER",
"GREATEREQUAL",
"INDENT",
"ISEOF",
"ISNONTERMINAL",
"ISTERMINAL",
"LBRACE",
"LEFTSHIFT",
"LEFTSHIFTEQUAL",
"LESS",
"LESSEQUAL",
"LPAR",
"LSQB",
"MINEQUAL",
"MINUS",
"NAME",
"NEWLINE",
"NL",
"NOTEQUAL",
"NT_OFFSET",
"NUMBER",
"N_TOKENS",
"OP",
"PERCENT",
"PERCENTEQUAL",
"PLUS",
"PLUSEQUAL",
"RARROW",
"RBRACE",
"RIGHTSHIFT",
"RIGHTSHIFTEQUAL",
"RPAR",
"RSQB",
"SEMI",
"SLASH",
"SLASHEQUAL",
"STAR",
"STAREQUAL",
"STRING",
"TILDE",
"VBAR",
"VBAREQUAL",
"tok_name",
"tokenize",
"generate_tokens",
"untokenize",
]
else:
__all__ = [
"AMPER",
"AMPEREQUAL",
"ASYNC",
"AT",
"ATEQUAL",
"AWAIT",
"BACKQUOTE",
"CIRCUMFLEX",
"CIRCUMFLEXEQUAL",
"COLON",
"COMMA",
"COMMENT",
"DEDENT",
"DOT",
"DOUBLESLASH",
"DOUBLESLASHEQUAL",
"DOUBLESTAR",
"DOUBLESTAREQUAL",
"ENDMARKER",
"EQEQUAL",
"EQUAL",
"ERRORTOKEN",
"GREATER",
"GREATEREQUAL",
"INDENT",
"ISEOF",
"ISNONTERMINAL",
"ISTERMINAL",
"LBRACE",
"LEFTSHIFT",
"LEFTSHIFTEQUAL",
"LESS",
"LESSEQUAL",
"LPAR",
"LSQB",
"MINEQUAL",
"MINUS",
"NAME",
"NEWLINE",
"NL",
"NOTEQUAL",
"NT_OFFSET",
"NUMBER",
"N_TOKENS",
"OP",
"PERCENT",
"PERCENTEQUAL",
"PLUS",
"PLUSEQUAL",
"RARROW",
"RBRACE",
"RIGHTSHIFT",
"RIGHTSHIFTEQUAL",
"RPAR",
"RSQB",
"SEMI",
"SLASH",
"SLASHEQUAL",
"STAR",
"STAREQUAL",
"STRING",
"TILDE",
"VBAR",
"VBAREQUAL",
"tok_name",
"tokenize",
"generate_tokens",
"untokenize",
]
_Coord = tuple[int, int]
_TokenEater = Callable[[int, str, _Coord, _Coord, str], None]
_TokenInfo = tuple[int, str, _Coord, _Coord, str]

View File

@@ -1,5 +1,11 @@
import sys
from typing import Any, Protocol
if sys.version_info >= (3, 9):
__all__ = ["getline", "clearcache", "checkcache", "lazycache"]
else:
__all__ = ["getline", "clearcache", "checkcache"]
_ModuleGlobals = dict[str, Any]
_ModuleMetadata = tuple[int, float, list[str], str]

View File

@@ -1,6 +1,32 @@
import sys
from _typeshed import StrPath
__all__ = [
"getlocale",
"getdefaultlocale",
"getpreferredencoding",
"Error",
"setlocale",
"resetlocale",
"localeconv",
"strcoll",
"strxfrm",
"str",
"atof",
"atoi",
"format",
"format_string",
"currency",
"normalize",
"LC_CTYPE",
"LC_COLLATE",
"LC_MESSAGES" "LC_TIME",
"LC_MONETARY",
"LC_NUMERIC",
"LC_ALL",
"CHAR_MAX",
]
# This module defines a function "str()", which is why "str" can't be used
# as a type annotation or type alias.
from builtins import str as _str

View File

@@ -9,6 +9,51 @@ from types import FrameType, TracebackType
from typing import Any, ClassVar, Generic, Optional, Pattern, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
__all__ = [
"BASIC_FORMAT",
"BufferingFormatter",
"CRITICAL",
"DEBUG",
"ERROR",
"FATAL",
"FileHandler",
"Filter",
"Formatter",
"Handler",
"INFO",
"LogRecord",
"Logger",
"LoggerAdapter",
"NOTSET",
"NullHandler",
"StreamHandler",
"WARN",
"WARNING",
"addLevelName",
"basicConfig",
"captureWarnings",
"critical",
"debug",
"disable",
"error",
"exception",
"fatal",
"getLevelName",
"getLogger",
"getLoggerClass",
"info",
"log",
"makeLogRecord",
"setLoggerClass",
"shutdown",
"warn",
"warning",
"getLogRecordFactory",
"setLogRecordFactory",
"lastResort",
"raiseExceptions",
]
_SysExcInfoType = Union[tuple[type[BaseException], BaseException, Optional[TracebackType]], tuple[None, None, None]]
_ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException]
_ArgsType = Union[tuple[object, ...], Mapping[str, object]]

View File

@@ -3,6 +3,45 @@ from _typeshed import ReadableBuffer, Self, StrOrBytesPath
from typing import IO, Any, Mapping, Sequence, TextIO, Union, overload
from typing_extensions import Literal, final
__all__ = [
"CHECK_NONE",
"CHECK_CRC32",
"CHECK_CRC64",
"CHECK_SHA256",
"CHECK_ID_MAX",
"CHECK_UNKNOWN",
"FILTER_LZMA1",
"FILTER_LZMA2",
"FILTER_DELTA",
"FILTER_X86",
"FILTER_IA64",
"FILTER_ARM",
"FILTER_ARMTHUMB",
"FILTER_POWERPC",
"FILTER_SPARC",
"FORMAT_AUTO",
"FORMAT_XZ",
"FORMAT_ALONE",
"FORMAT_RAW",
"MF_HC3",
"MF_HC4",
"MF_BT2",
"MF_BT3",
"MF_BT4",
"MODE_FAST",
"MODE_NORMAL",
"PRESET_DEFAULT",
"PRESET_EXTREME",
"LZMACompressor",
"LZMADecompressor",
"LZMAFile",
"LZMAError",
"open",
"compress",
"decompress",
"is_check_supported",
]
_OpenBinaryWritingMode = Literal["w", "wb", "x", "xb", "a", "ab"]
_OpenTextWritingMode = Literal["wt", "xt", "at"]