Skip to content

Commit

Permalink
add an essay explaining the return annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Jul 28, 2023
1 parent bdd377c commit a5103be
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit a5103be

Please sign in to comment.