Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 14, 2017

return make_const(node, newval, arena);
}

static int
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here.

Copy link
Member Author

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.

@serhiy-storchaka serhiy-storchaka merged commit 15a8728 into python:master Dec 14, 2017
@serhiy-storchaka serhiy-storchaka deleted the ast-opt-fold-iter branch December 14, 2017 18:24
@methane
Copy link
Member

methane commented Dec 15, 2017

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants