[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-03-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-03-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 3f7e9aa2ef215917b9f1521441f67f4ecd33a1bc by Serhiy Storchaka in branch 'master': bpo-32925: Optimized iterating and containing test for literal lists (GH-5842)

[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The direct inspiration of this optimization was your note that similar optimization was implemented in Python. -- ___ Python tracker

[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-02-24 Thread Stefan Behnel
Stefan Behnel added the comment: An obvious optimisation, if you ask me. PR looks good to me superficially, but I don't know the AST code well. -- nosy: +scoder ___ Python tracker

[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-02-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +5617 stage: -> patch review ___ Python tracker ___

[issue32925] AST optimizer: Change a list into tuple in iterations and containment tests

2018-02-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently a list of constants is replaced with constant tuple in `x in [1, 2]` and `for x in [1, 2]`. The resulted AST is the same as for `x in (1, 2)` and `for x in (1, 2)`. The proposed simple PR extends this optimization