我尝试在python IDLE中执行以下代码
from __future__ import braces
我得到了以下错误:
SyntaxError: not a chance
上述错误是什么意思?
我尝试在python IDLE中执行以下代码
from __future__ import braces
我得到了以下错误:
SyntaxError: not a chance
上述错误是什么意思?
Answers:
您已经在Python中找到了一个复活节彩蛋。开个玩笑。
这意味着永远不会实现用大括号而不是缩进来分隔块。
通常,从特殊__future__模块导入会启用向后不兼容的print()功能,例如功能或真正的划分。
因此,线from __future__ import braces被认为是指你要启用该功能“用括号来创建块”,异常告诉您那的机会不断发生的零。
您可以添加到包括在Python中-笑话的一大串,就像import __hello__,import this和import antigravity。Python开发人员具有良好的幽默感!
Less Whitespace, More Enterprise:D谢谢!