diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 8e5194e9869b..dec7d09490a3 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -51,7 +51,6 @@ "stubs/httplib2", "stubs/hvac", "stubs/icalendar", - "stubs/jmespath", "stubs/jsonschema", "stubs/jwcrypto", "stubs/ldap3", diff --git a/stubs/jmespath/jmespath/ast.pyi b/stubs/jmespath/jmespath/ast.pyi index 76651892e03d..a9ee32a7c6b4 100644 --- a/stubs/jmespath/jmespath/ast.pyi +++ b/stubs/jmespath/jmespath/ast.pyi @@ -52,4 +52,4 @@ def pipe(left: _ASTNode, right: _ASTNode) -> _ASTNode: ... def projection(left: _ASTNode, right: _ASTNode) -> _ASTNode: ... def subexpression(children: list[_ASTNode]) -> _ASTNode: ... def slice(start: _ASTNode, end: _ASTNode, step: _ASTNode) -> _ASTNode: ... -def value_projection(left, right) -> _ASTNode: ... +def value_projection(left: _ASTNode, right: _ASTNode) -> _ASTNode: ... diff --git a/stubs/jmespath/jmespath/exceptions.pyi b/stubs/jmespath/jmespath/exceptions.pyi index 13500a8e0b58..45a6c4ec514e 100644 --- a/stubs/jmespath/jmespath/exceptions.pyi +++ b/stubs/jmespath/jmespath/exceptions.pyi @@ -30,7 +30,7 @@ class ArityError(ParseError): expected_arity: int actual_arity: int function_name: str - def __init__(self, expected, actual, name) -> None: ... + def __init__(self, expected: int, actual: int, name: str) -> None: ... class VariadictArityError(ArityError): ... diff --git a/stubs/jmespath/jmespath/visitor.pyi b/stubs/jmespath/jmespath/visitor.pyi index 64125ddd176f..fb8c3f63dd9a 100644 --- a/stubs/jmespath/jmespath/visitor.pyi +++ b/stubs/jmespath/jmespath/visitor.pyi @@ -17,11 +17,14 @@ class _Expression: expression: str interpreter: Visitor def __init__(self, expression: str, interpreter: Visitor) -> None: ... - def visit(self, node: _TreeNode, *args, **kwargs) -> Any: ... + # `args` and `kwargs` are passed to the appropriate `visit_*` method. + def visit(self, node: _TreeNode, *args: Any, **kwargs: Any) -> Any: ... class Visitor: def __init__(self) -> None: ... - def visit(self, node: _TreeNode, *args, **kwargs) -> Any: ... + # `args` and `kwargs` are passed to the appropriate `visit_*` method. + # Its return value is returned from visit. + def visit(self, node: _TreeNode, *args: Any, **kwargs: Any) -> Any: ... def default_visit(self, node: _TreeNode, *args: Unused, **kwargs: Unused) -> NoReturn: ... class _TreeNode(TypedDict): @@ -59,4 +62,4 @@ class TreeInterpreter(Visitor): class GraphvizVisitor(Visitor): def __init__(self) -> None: ... - def visit(self, node: _TreeNode, *args, **kwargs) -> str: ... + def visit(self, node: _TreeNode, *args: Unused, **kwargs: Unused) -> str: ...