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