Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

if 1 else #17

Open
rocky opened this issue Apr 15, 2017 · 0 comments
Open

if 1 else #17

rocky opened this issue Apr 15, 2017 · 0 comments

Comments

@rocky
Copy link

rocky commented Apr 15, 2017

Python 2.7 generates special code for expression x if 1 else y as opposed to x if True else y and this causes a parse error.

To repeat try:
1 if 1 else __file__

Or see https://github.com/rocky/python-uncompyle6/blob/master/test/bytecode_2.7/03_if_1_else.pyc

Grammar code from https://github.com/rocky/python-uncompyle6/ could probably be used here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant