Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87de2fb

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

File tree

Expand file treeCollapse file tree

2 files changed

+5
-7
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-7
lines changed

‎Tools/clinic/clinic.py

Copy file name to clipboardExpand all lines: Tools/clinic/clinic.py
+4-3Lines 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

Copy file name to clipboardExpand all lines: Tools/clinic/mypy.ini
+1-4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.