8000 gh-104050: Argument clinic: enable mypy's `--warn-return-any` setting… · python/cpython@87de2fb · GitHub
[go: up one dir, main page]

Skip to content

Commit 87de2fb

Browse files
authored
gh-104050: Argument clinic: enable mypy's --warn-return-any setting (#107405)
1 parent 37551c9 commit 87de2fb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Tools/clinic/clinic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4288,10 +4288,11 @@ def eval_ast_expr(
42884288
globals: dict[str, Any],
42894289
*,
42904290
filename: str = '-'
4291-
) -> FunctionType:
4291+
) -> Any:
42924292
"""
4293-
Takes an ast.Expr node. Compiles and evaluates it.
4294-
Returns the result of the expression.
4293+
Takes an ast.Expr node. Compiles it into a function object,
4294+
then calls the function object with 0 arguments.
4295+
Returns the result of that function call.
42954296
42964297
globals represents the globals dict the expression
42974298
should see. (There's no equivalent for "locals" here.)

Tools/clinic/mypy.ini

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ pretty = True
55
# make sure clinic can still be run on Python 3.10
66
python_version = 3.10
77

8-
# be strict...
8+
# and be strict!
99
strict = True
1010
strict_concatenate = True
1111
enable_error_code = ignore-without-code,redundant-expr
1212
warn_unreachable = True
13-
14-
# ...except for one extra rule we can't enable just yet
15-
warn_return_any = False

0 commit comments

Comments
 (0)
0