summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorAlex Waygood <Alex.Waygood@Gmail.com>2023-07-29 12:39:21 (GMT)
committerGitHub <noreply@github.com>2023-07-29 12:39:21 (GMT)
commit87de2fbb1e9b94f25ae8c0c233fb4690a13e4b02 (patch)
tree64a921b19bd67bc5aacf81deee8e285c953870e1 /Tools
parent37551c9cef307ca3172c60b28c7de9db921808ad (diff)
downloadcpython-87de2fbb1e9b94f25ae8c0c233fb4690a13e4b02.zip
cpython-87de2fbb1e9b94f25ae8c0c233fb4690a13e4b02.tar.gz
cpython-87de2fbb1e9b94f25ae8c0c233fb4690a13e4b02.tar.bz2
gh-104050: Argument clinic: enable mypy's `--warn-return-any` setting (#107405)
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/clinic/clinic.py7
-rw-r--r--Tools/clinic/mypy.ini5
2 files changed, 5 insertions, 7 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 6bfa6d0..cb999c1 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -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.)
diff --git a/Tools/clinic/mypy.ini b/Tools/clinic/mypy.ini
index 4aa65a5..4cfc05b 100644
--- a/Tools/clinic/mypy.ini
+++ b/Tools/clinic/mypy.ini
@@ -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