Skip to content

Commit

Permalink
gh-104050: Argument clinic: enable mypy's --warn-return-any setting (
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Jul 29, 2023
1 parent 37551c9 commit 87de2fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 4 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
5 changes: 1 addition & 4 deletions Tools/clinic/mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 87de2fb

Please sign in to comment.