Files
jedi/test/static_analysis/branches.py
Dave Halter d694ab83a3 Memoizing statements doesn't work anymore.
Statements now need to be evaluated at least if predefined_names_dict is set.
2015-06-29 13:32:39 +02:00

29 lines
433 B
Python

import random
if random.choice([0, 1]):
x = ''
else:
x = 1
if random.choice([0, 1]):
y = ''
else:
y = 1
# A simple test
if x != 1:
x.upper()
else:
#! 2 attribute-error
x.upper()
pass
# This operation is wrong, because the types could be different.
#! 6 type-error-operation
z = x + y
# However, here we have correct types.
if x == y:
z = x + y
else:
#! 6 type-error-operation
z = x + y