Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add an essay explaining the return annotation
  • Loading branch information
AlexWaygood authored Jul 28, 2023
commit a5103bef7682f04062c393fae08584f3905f8ed3
5 changes: 5 additions & 0 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4283,6 +4283,11 @@ class float_return_converter(double_return_converter):
cast = '(double)'


# What do we do in this function?
# We take an arbitrary AST node, compile the node into a function object,
# call that function with 0 arguments, and return whatever the call returns.
# The only possible return annotations here would be `object` or `Any`,
# and `object` would be too annoying. Return `Any`!
def eval_ast_expr(
node: ast.expr,
globals: dict[str, Any],
Expand Down