2017-02-06 23:55:37 -05:00
|
|
|
"""
|
|
|
|
categories: Syntax,Spaces
|
|
|
|
description: uPy requires spaces between literal numbers and keywords, CPy doesn't
|
|
|
|
cause: Unknown
|
|
|
|
workaround: Unknown
|
|
|
|
"""
|
|
|
|
try:
|
2020-03-22 22:26:08 -04:00
|
|
|
print(eval("1and 0"))
|
2017-02-06 23:55:37 -05:00
|
|
|
except SyntaxError:
|
2020-03-22 22:26:08 -04:00
|
|
|
print("Should have worked")
|
2017-02-06 23:55:37 -05:00
|
|
|
try:
|
2020-03-22 22:26:08 -04:00
|
|
|
print(eval("1or 0"))
|
2017-02-06 23:55:37 -05:00
|
|
|
except SyntaxError:
|
2020-03-22 22:26:08 -04:00
|
|
|
print("Should have worked")
|
2017-02-06 23:55:37 -05:00
|
|
|
try:
|
2020-03-22 22:26:08 -04:00
|
|
|
print(eval("1if 1else 0"))
|
2017-02-06 23:55:37 -05:00
|
|
|
except SyntaxError:
|
2020-03-22 22:26:08 -04:00
|
|
|
print("Should have worked")
|