Anu*_*rma 104 python syntax-error curly-braces
我尝试在python IDLE中执行以下代码
from __future__ import braces
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
SyntaxError: not a chance
Run Code Online (Sandbox Code Playgroud)
上述错误是什么意思?
Mar*_*ers 152
你在Python中找到了一个复活节彩蛋.这是个玩笑.
这意味着永远不会实现用大括号而不是缩进来分隔块.
通常,从特殊__future__模块导入启用向后不兼容的print()功能,例如功能或真正的分区.
因此,线from __future__ import braces被认为是指你要启用该功能"用括号来创建块",异常告诉您的是机会不断发生是零.
您可以添加到在-笑话包含在Python,就像长长的名单import __hello__,import this和import antigravity.Python开发人员具有良好的幽默感!
zha*_*gyu 25
该__future__模块通常用于提供未来版本的Python的功能.
这是一个复活节彩蛋,总结了开发者在这个问题上的感受.
还有几个:
import this 将显示Python的禅宗.
import __hello__会显示Hello World....
在Python 2.7和3.0中,import antigravity将浏览器打开为漫画!