mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Add default values for third-party stubs beginning with 'P' (#9957)
This commit is contained in:
@@ -8,9 +8,9 @@ __all__ = ["check", "checkPath", "checkRecursive", "iterSourceCode", "main"]
|
||||
|
||||
PYTHON_SHEBANG_REGEX: Pattern[bytes]
|
||||
|
||||
def check(codeString: str, filename: str, reporter: Reporter | None = ...) -> int: ...
|
||||
def checkPath(filename, reporter: Reporter | None = ...) -> int: ...
|
||||
def check(codeString: str, filename: str, reporter: Reporter | None = None) -> int: ...
|
||||
def checkPath(filename, reporter: Reporter | None = None) -> int: ...
|
||||
def isPythonFile(filename) -> bool: ...
|
||||
def iterSourceCode(paths: Iterable[Any]) -> Iterator[Any]: ...
|
||||
def checkRecursive(paths: Iterable[Any], reporter: Reporter) -> int: ...
|
||||
def main(prog: str | None = ..., args: Sequence[Any] | None = ...) -> None: ...
|
||||
def main(prog: str | None = None, args: Sequence[Any] | None = None) -> None: ...
|
||||
|
||||
@@ -37,7 +37,7 @@ def counter(items: Iterable[_T]) -> dict[_T, int]: ...
|
||||
|
||||
_OmitType: TypeAlias = str | tuple[str, ...] | None
|
||||
|
||||
def iter_child_nodes(node: ast.AST, omit: _OmitType = ..., _fields_order: _FieldsOrder = ...) -> Iterator[ast.AST]: ...
|
||||
def iter_child_nodes(node: ast.AST, omit: _OmitType = None, _fields_order: _FieldsOrder = ...) -> Iterator[ast.AST]: ...
|
||||
@overload
|
||||
def convert_to_value(item: ast.Str) -> str: ... # type: ignore[misc]
|
||||
@overload
|
||||
@@ -73,7 +73,7 @@ class VariableKey:
|
||||
class Importation(Definition):
|
||||
fullName: str
|
||||
redefined: list[Any]
|
||||
def __init__(self, name: str, source: ast.AST | None, full_name: str | None = ...) -> None: ...
|
||||
def __init__(self, name: str, source: ast.AST | None, full_name: str | None = None) -> None: ...
|
||||
@property
|
||||
def source_statement(self) -> str: ...
|
||||
|
||||
@@ -83,7 +83,7 @@ class SubmoduleImportation(Importation):
|
||||
class ImportationFrom(Importation):
|
||||
module: str
|
||||
real_name: str
|
||||
def __init__(self, name: str, source: ast.AST, module: str, real_name: str | None = ...) -> None: ...
|
||||
def __init__(self, name: str, source: ast.AST, module: str, real_name: str | None = None) -> None: ...
|
||||
|
||||
class StarImportation(Importation):
|
||||
def __init__(self, name: str, source: ast.AST) -> None: ...
|
||||
@@ -183,10 +183,10 @@ class Checker:
|
||||
def __init__(
|
||||
self,
|
||||
tree: ast.AST,
|
||||
filename: str = ...,
|
||||
builtins: Iterable[str] | None = ...,
|
||||
withDoctest: bool = ...,
|
||||
file_tokens: tuple[Any, ...] = ...,
|
||||
filename: str = "(none)",
|
||||
builtins: Iterable[str] | None = None,
|
||||
withDoctest: bool = False,
|
||||
file_tokens: tuple[Any, ...] = (),
|
||||
) -> None: ...
|
||||
def deferFunction(self, callable: _AnyFunction) -> None: ...
|
||||
def deferAssignment(self, callable: _AnyFunction) -> None: ...
|
||||
@@ -215,7 +215,7 @@ class Checker:
|
||||
def handleNodeLoad(self, node: ast.AST, parent: ast.AST) -> None: ...
|
||||
def handleNodeStore(self, node: ast.AST) -> None: ...
|
||||
def handleNodeDelete(self, node: ast.AST) -> None: ...
|
||||
def handleChildren(self, tree: ast.AST, omit: _OmitType = ...) -> None: ...
|
||||
def handleChildren(self, tree: ast.AST, omit: _OmitType = None) -> None: ...
|
||||
def isLiteralTupleUnpacking(self, node: ast.AST) -> bool | None: ...
|
||||
def isDocstring(self, node: ast.AST) -> bool: ...
|
||||
def getDocstring(self, node: ast.AST) -> tuple[str, int] | tuple[None, None]: ...
|
||||
@@ -224,23 +224,23 @@ class Checker:
|
||||
def handleStringAnnotation(self, s: str, node: ast.AST, ref_lineno: int, ref_col_offset: int, err: type[Message]) -> None: ...
|
||||
def handleAnnotation(self, annotation: ast.AST, node: ast.AST) -> None: ...
|
||||
def ignore(self, node: ast.AST) -> None: ...
|
||||
def DELETE(self, tree: ast.Delete, omit: _OmitType = ...) -> None: ...
|
||||
def FOR(self, tree: ast.For, omit: _OmitType = ...) -> None: ...
|
||||
def ASYNCFOR(self, tree: ast.AsyncFor, omit: _OmitType = ...) -> None: ...
|
||||
def WHILE(self, tree: ast.While, omit: _OmitType = ...) -> None: ...
|
||||
def WITH(self, tree: ast.With, omit: _OmitType = ...) -> None: ...
|
||||
def WITHITEM(self, tree: ast.AST, omit: _OmitType = ...) -> None: ...
|
||||
def ASYNCWITH(self, tree: ast.AsyncWith, omit: _OmitType = ...) -> None: ...
|
||||
def EXPR(self, tree: ast.AST, omit: _OmitType = ...) -> None: ...
|
||||
def ASSIGN(self, tree: ast.Assign, omit: _OmitType = ...) -> None: ...
|
||||
def DELETE(self, tree: ast.Delete, omit: _OmitType = None) -> None: ...
|
||||
def FOR(self, tree: ast.For, omit: _OmitType = None) -> None: ...
|
||||
def ASYNCFOR(self, tree: ast.AsyncFor, omit: _OmitType = None) -> None: ...
|
||||
def WHILE(self, tree: ast.While, omit: _OmitType = None) -> None: ...
|
||||
def WITH(self, tree: ast.With, omit: _OmitType = None) -> None: ...
|
||||
def WITHITEM(self, tree: ast.AST, omit: _OmitType = None) -> None: ...
|
||||
def ASYNCWITH(self, tree: ast.AsyncWith, omit: _OmitType = None) -> None: ...
|
||||
def EXPR(self, tree: ast.AST, omit: _OmitType = None) -> None: ...
|
||||
def ASSIGN(self, tree: ast.Assign, omit: _OmitType = None) -> None: ...
|
||||
def PASS(self, node: ast.AST) -> None: ...
|
||||
def BOOLOP(self, tree: ast.BoolOp, omit: _OmitType = ...) -> None: ...
|
||||
def UNARYOP(self, tree: ast.UnaryOp, omit: _OmitType = ...) -> None: ...
|
||||
def SET(self, tree: ast.Set, omit: _OmitType = ...) -> None: ...
|
||||
def ATTRIBUTE(self, tree: ast.Attribute, omit: _OmitType = ...) -> None: ...
|
||||
def STARRED(self, tree: ast.Starred, omit: _OmitType = ...) -> None: ...
|
||||
def NAMECONSTANT(self, tree: ast.NameConstant, omit: _OmitType = ...) -> None: ...
|
||||
def NAMEDEXPR(self, tree: _NamedExpr, omit: _OmitType = ...) -> None: ...
|
||||
def BOOLOP(self, tree: ast.BoolOp, omit: _OmitType = None) -> None: ...
|
||||
def UNARYOP(self, tree: ast.UnaryOp, omit: _OmitType = None) -> None: ...
|
||||
def SET(self, tree: ast.Set, omit: _OmitType = None) -> None: ...
|
||||
def ATTRIBUTE(self, tree: ast.Attribute, omit: _OmitType = None) -> None: ...
|
||||
def STARRED(self, tree: ast.Starred, omit: _OmitType = None) -> None: ...
|
||||
def NAMECONSTANT(self, tree: ast.NameConstant, omit: _OmitType = None) -> None: ...
|
||||
def NAMEDEXPR(self, tree: _NamedExpr, omit: _OmitType = None) -> None: ...
|
||||
def SUBSCRIPT(self, node: ast.Subscript) -> None: ...
|
||||
def CALL(self, node: ast.Call) -> None: ...
|
||||
def BINOP(self, node: ast.BinOp) -> None: ...
|
||||
@@ -251,9 +251,9 @@ class Checker:
|
||||
def ELLIPSIS(self, node: ast.Ellipsis) -> None: ...
|
||||
|
||||
def STR(self, node: ast.Str) -> None: ...
|
||||
def SLICE(self, tree: ast.Slice, omit: _OmitType = ...) -> None: ...
|
||||
def EXTSLICE(self, tree: ast.ExtSlice, omit: _OmitType = ...) -> None: ...
|
||||
def INDEX(self, tree: ast.Index, omit: _OmitType = ...) -> None: ...
|
||||
def SLICE(self, tree: ast.Slice, omit: _OmitType = None) -> None: ...
|
||||
def EXTSLICE(self, tree: ast.ExtSlice, omit: _OmitType = None) -> None: ...
|
||||
def INDEX(self, tree: ast.Index, omit: _OmitType = None) -> None: ...
|
||||
def LOAD(self, node: ast.Load) -> None: ...
|
||||
def STORE(self, node: ast.Store) -> None: ...
|
||||
def DEL(self, node: ast.Del) -> None: ...
|
||||
@@ -290,9 +290,9 @@ class Checker:
|
||||
def NOTIN(self, node: ast.NotIn) -> None: ...
|
||||
def MATMULT(self, node: ast.MatMult) -> None: ...
|
||||
def RAISE(self, node: ast.Raise) -> None: ...
|
||||
def COMPREHENSION(self, tree: ast.comprehension, omit: _OmitType = ...) -> None: ...
|
||||
def KEYWORD(self, tree: ast.keyword, omit: _OmitType = ...) -> None: ...
|
||||
def FORMATTEDVALUE(self, tree: ast.FormattedValue, omit: _OmitType = ...) -> None: ...
|
||||
def COMPREHENSION(self, tree: ast.comprehension, omit: _OmitType = None) -> None: ...
|
||||
def KEYWORD(self, tree: ast.keyword, omit: _OmitType = None) -> None: ...
|
||||
def FORMATTEDVALUE(self, tree: ast.FormattedValue, omit: _OmitType = None) -> None: ...
|
||||
def JOINEDSTR(self, node: ast.AST) -> None: ...
|
||||
def DICT(self, node: ast.Dict) -> None: ...
|
||||
def IF(self, node: ast.If) -> None: ...
|
||||
@@ -326,13 +326,13 @@ class Checker:
|
||||
def EXCEPTHANDLER(self, node: ast.ExceptHandler) -> None: ...
|
||||
def ANNASSIGN(self, node: ast.AnnAssign) -> None: ...
|
||||
def COMPARE(self, node: ast.Compare) -> None: ...
|
||||
def MATCH(self, tree: _Match, omit: _OmitType = ...) -> None: ...
|
||||
def MATCH_CASE(self, tree: _MatchCase, omit: _OmitType = ...) -> None: ...
|
||||
def MATCHCLASS(self, tree: _MatchClass, omit: _OmitType = ...) -> None: ...
|
||||
def MATCHOR(self, tree: _MatchOr, omit: _OmitType = ...) -> None: ...
|
||||
def MATCHSEQUENCE(self, tree: _MatchSequence, omit: _OmitType = ...) -> None: ...
|
||||
def MATCHSINGLETON(self, tree: _MatchSingleton, omit: _OmitType = ...) -> None: ...
|
||||
def MATCHVALUE(self, tree: _MatchValue, omit: _OmitType = ...) -> None: ...
|
||||
def MATCH(self, tree: _Match, omit: _OmitType = None) -> None: ...
|
||||
def MATCH_CASE(self, tree: _MatchCase, omit: _OmitType = None) -> None: ...
|
||||
def MATCHCLASS(self, tree: _MatchClass, omit: _OmitType = None) -> None: ...
|
||||
def MATCHOR(self, tree: _MatchOr, omit: _OmitType = None) -> None: ...
|
||||
def MATCHSEQUENCE(self, tree: _MatchSequence, omit: _OmitType = None) -> None: ...
|
||||
def MATCHSINGLETON(self, tree: _MatchSingleton, omit: _OmitType = None) -> None: ...
|
||||
def MATCHVALUE(self, tree: _MatchValue, omit: _OmitType = None) -> None: ...
|
||||
def MATCHAS(self, node: _MatchAs) -> None: ...
|
||||
def MATCHMAPPING(self, node: _MatchMapping) -> None: ...
|
||||
def MATCHSTAR(self, node: _MatchStar) -> None: ...
|
||||
|
||||
@@ -39,7 +39,7 @@ class UndefinedName(Message):
|
||||
|
||||
class DoctestSyntaxError(Message):
|
||||
message_args: tuple[()]
|
||||
def __init__(self, filename, loc: ast.AST, position: tuple[int, int] | None = ...) -> None: ...
|
||||
def __init__(self, filename, loc: ast.AST, position: tuple[int, int] | None = None) -> None: ...
|
||||
|
||||
class UndefinedExport(Message):
|
||||
message_args: tuple[Any]
|
||||
|
||||
Reference in New Issue
Block a user