]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104050: Argument clinic: enable mypy's `--warn-return-any` setting (#107405)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Sat, 29 Jul 2023 12:39:21 +0000 (13:39 +0100)
committerGitHub <noreply@github.com>
Sat, 29 Jul 2023 12:39:21 +0000 (13:39 +0100)
Tools/clinic/clinic.py
Tools/clinic/mypy.ini

index 6bfa6d0d568146d93edda8761e7038c43ecdd8b4..cb999c156ee28b2537cd1f868ec1f760f21b80d7 100755 (executable)
@@ -4288,10 +4288,11 @@ def eval_ast_expr(
         globals: dict[str, Any],
         *,
         filename: str = '-'
-) -> FunctionType:
+) -> Any:
     """
-    Takes an ast.Expr node.  Compiles and evaluates it.
-    Returns the result of the expression.
+    Takes an ast.Expr node.  Compiles it into a function object,
+    then calls the function object with 0 arguments.
+    Returns the result of that function call.
 
     globals represents the globals dict the expression
     should see.  (There's no equivalent for "locals" here.)
index 4aa65a5c14489fa464a45dc2601366379866e0a5..4cfc05bec01608ef163ab9da31905422aa1c924d 100644 (file)
@@ -5,11 +5,8 @@ pretty = True
 # make sure clinic can still be run on Python 3.10
 python_version = 3.10
 
-# be strict...
+# and be strict!
 strict = True
 strict_concatenate = True
 enable_error_code = ignore-without-code,redundant-expr
 warn_unreachable = True
-
-# ...except for one extra rule we can't enable just yet
-warn_return_any = False