Files
python-uncompyle6/test/simple_source/bug30/01_ops.py
rocky 1823513841 3.x Grammar reduction of custom rules...
by looking for token patterns GET_ITER CALL_FUNCTION_1
2017-11-23 07:47:38 -05:00

17 lines
385 B
Python

# Statements to beef up grammar coverage rules
# Force "inplace" ops
y = +10 # UNARY_POSITIVE
y /= 1 # INPLACE_DIVIDE
y %= 4 # INPLACE_MODULO
y **= 1 # INPLACE POWER
y >>= 2 # INPLACE_RSHIFT
y <<= 2 # INPLACE_LSHIFT
y //= 1 # INPLACE_TRUE_DIVIDE
y &= 1 # INPLACE_AND
y ^= 1 # INPLACE_XOR
# Beef up augassign and STORE_SLICE+3
x = [1,2,3,4,5]
x[0:1] = 1
x[0:3] += 1, 2, 3