2017-02-07 15:55:37 +11:00
|
|
|
"""
|
|
|
|
categories: Syntax,Spaces
|
|
|
|
description: uPy requires spaces between literal numbers and keywords, CPy doesn't
|
|
|
|
cause: Unknown
|
|
|
|
workaround: Unknown
|
|
|
|
"""
|
|
|
|
try:
|
2021-03-15 19:27:36 +05:30
|
|
|
print(eval("1and 0"))
|
2017-02-07 15:55:37 +11:00
|
|
|
except SyntaxError:
|
2021-03-15 19:27:36 +05:30
|
|
|
print("Should have worked")
|
2017-02-07 15:55:37 +11:00
|
|
|
try:
|
2021-03-15 19:27:36 +05:30
|
|
|
print(eval("1or 0"))
|
2017-02-07 15:55:37 +11:00
|
|
|
except SyntaxError:
|
2021-03-15 19:27:36 +05:30
|
|
|
print("Should have worked")
|
2017-02-07 15:55:37 +11:00
|
|
|
try:
|
2021-03-15 19:27:36 +05:30
|
|
|
print(eval("1if 1else 0"))
|
2017-02-07 15:55:37 +11:00
|
|
|
except SyntaxError:
|
2021-03-15 19:27:36 +05:30
|
|
|
print("Should have worked")
|