You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
12 lines
441 B
Python
12 lines
441 B
Python
# Bug from issue #171: parsing "if x if a else y" inside a list comprehension on 2.7
|
|
# This is RUNNABLE!
|
|
assert [False, True, True, True, True] == [False if not a else True for a in range(5)]
|
|
assert [True, False, False, False, False] == [False if a else True for a in range(5)]
|
|
|
|
# From bug #225
|
|
m = ['hi', 'he', 'ih', 'who', 'ho']
|
|
ms = {}
|
|
for f in (f for f in m if f.startswith('h')):
|
|
ms[f] = 5
|
|
assert ms == {'hi': 5, 'he': 5, 'ho': 5}
|