bpo-29469: Optimize literal lists and sets iterating on the AST level. by serhiy-storchaka · Pull Request #4866 · python/cpython
| return make_const(node, newval, arena); | ||
| } | ||
|
|
||
| static int |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add comments and/or a "docstring" to explain what this is doing.
| } | ||
|
|
||
| static int | ||
| fold_compare(expr_ty node, PyArena *arena) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already is documented inside the function. In future the optimization for literal operands (like 1 < 2) can be added here, but currently it optimizes only the particular case of 'in' and 'not in' operators.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters