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 a5103be

Browse filesBrowse files
authored
add an essay explaining the return annotation
1 parent bdd377c commit a5103be
Copy full SHA for a5103be

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-0
lines changed

‎Tools/clinic/clinic.py

Copy file name to clipboardExpand all lines: Tools/clinic/clinic.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4283,6 +4283,11 @@ class float_return_converter(double_return_converter):
42834283
cast = '(double)'
42844284

42854285

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.