语法错误:不是机会 [英] Syntax Error: Not a Chance
问题描述
我尝试在python IDLE中执行以下代码
I tried executed the following code in the python IDLE
from __future__ import braces
我收到以下错误:
SyntaxError: not a chance
上述错误是什么意思?
What does the above error mean?
推荐答案
您已经在Python中找到了一个复活节彩蛋.这是个玩笑.
You have found an easter egg in Python. It is a joke.
这意味着将永远无法使用大括号而不是缩进来分隔块.
It means that delimiting blocks by braces instead of indentation will never be implemented.
通常,从特殊__future__
模块导入启用向后不兼容的功能,例如print()
函数或真正的除法.
Normally, imports from the special __future__
module enable features that are backwards-incompatible, such as the print()
function, or true division.
所以行from __future__ import braces
表示您想启用用括号创建块"功能,该异常告诉您永远发生的可能性为零.
So the line from __future__ import braces
is taken to mean you want to enable the 'create blocks with braces' feature, and the exception tells you your chances of that ever happening are nil.
您可以将其添加到Python中包含的一连串笑话中,就像import __hello__
,import this
和import antigravity
一样. Python开发人员具有良好的幽默感!
You can add that to the long list of in-jokes included in Python, just like import __hello__
, import this
and import antigravity
. The Python developers have a well-developed sense of humour!
这篇关于语法错误:不是机会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!