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:
|
2021-03-15 09:57:36 -04:00
|
|
|
print(eval("1and 0"))
|
2017-02-06 23:55:37 -05:00
|
|
|
except SyntaxError:
|
2021-03-15 09:57:36 -04:00
|
|
|
print("Should have worked")
|
2017-02-06 23:55:37 -05:00
|
|
|
try:
|
2021-03-15 09:57:36 -04:00
|
|
|
print(eval("1or 0"))
|
2017-02-06 23:55:37 -05:00
|
|
|
except SyntaxError:
|
2021-03-15 09:57:36 -04:00
|
|
|
print("Should have worked")
|
2017-02-06 23:55:37 -05:00
|
|
|
try:
|
2021-03-15 09:57:36 -04:00
|
|
|
print(eval("1if 1else 0"))
|
2017-02-06 23:55:37 -05:00
|
|
|
except SyntaxError:
|
2021-03-15 09:57:36 -04:00
|
|
|
print("Should have worked")
|