没有,错,真 [英] None, False, True
问题描述
任何人都可以解释一下:
Python 2.3(#46,2003年7月29日,18:54:32)[MSC v.1200 32位(英特尔)]在win32上br />
输入help,copyright,credit等等。或许可证或更多信息。
Can anybody explain this:
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
无= 3
< stdin>:1:SyntaxWarning:赋值给无假= 4
真= 5
无,假,真
(3,4,5)
None = 3 <stdin>:1: SyntaxWarning: assignment to None False = 4
True = 5
None, False, True (3, 4, 5)
>
推荐答案
MaS< NO ***** @ hotmail.com>这样说:
M-a-S <NO*****@hotmail.com> spake thusly:
任何人都可以解释一下:
Python 2.3(#46,2003年7月29日,18:54:32)[MSC v.1200 32 bit(Intel) ]
win32类型帮助,版权,信用等或许可证或更多信息。
Can anybody explain this:
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32 Type "help", "copyright", "credits" or "license" for more
information.
无= 3< stdin>:1:语法警告:赋值为无错误= 4
真= 5
无,假,真
None = 3 <stdin>:1: SyntaxWarning: assignment to None False = 4
True = 5
None, False, True
(3,4,5)
(3, 4, 5)
在上面链接底部附近的第5.9节(词汇表)中,我发现这个
条目为无...
无
由没有
返回语句的函数返回的特殊Python值,或者没有参数的return语句。
也许这与它有关。
-
删除BLINDERS给我发电子邮件。
音频圣经在线:
http://www.audio-bible.com/
In digo Moon Man写道:
Indigo Moon Man wrote:
M-a-S< NO ***** @ hotmail.com>这样说:
M-a-S <NO*****@hotmail.com> spake thusly:
任何人都可以解释一下:
Python 2.3(#46,2003年7月29日,18:54:32)[MSC v.1200 32位(英特尔)]
win32类型帮助,版权,信用和或许可证或更多
信息。
Can anybody explain this:
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32 Type "help", "copyright", "credits" or "license" for more
information.
>无= 3
< stdin>:1:语法警告:赋值给无< br>
<stdin>:1: SyntaxWarning: assignment to None
> False = 4
> True = 5
>
>无,False,True
>False = 4
>True = 5
>
>None, False, True
(3,4,5)
(3, 4, 5)
http://www.ibiblio.org/obp/thinkCSpy/chap05.htm
在上面链接底部附近的第5.9节(词汇表)中,我发现了这个无>输入无...
无
没有
return语句的函数返回的特殊Python值,或者没有参数的return语句。
也许这与它有关。
http://www.ibiblio.org/obp/thinkCSpy/chap05.htm
In section 5.9 (Glossary) near the bottom of the link above I found this
entry for None...
None
A special Python value returned by functions that have no
return statement, or a return statement without an argument.
Maybe that has something to do with it.
Defenitely。如果我没记错的话,很快就会将其提升为
关键字。因此警告。
hth,
anton。
Defenitely. If I remember it right, None is going to be promoted into
keywords soon. Therefore the warning.
hth,
anton.
" Ma -S" < NO ***** @ hotmail.com>写道:
"M-a-S" <NO*****@hotmail.com> writes:
任何人都可以解释一下:
Python 2.3(#46,2003年7月29日,18:54:32)[MSC v.1200 32 bit (英特尔)] on win32
输入help,copyright,credit等等。或许可证或更多信息
Can anybody explain this:
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information
无= 3< stdin>:1:SyntaxWarning:赋值为None False = 4
True = 5
无,假,真
None = 3 <stdin>:1: SyntaxWarning: assignment to None False = 4
True = 5
None, False, True
(3,4,5)
(3, 4, 5)
我相信有关于预防的讨论最近内置的
of builtins,所以它可能在未来发生(2.4?)。
Dunno为什么没有而不是True / False引起警告,但是你可以使用警告框架将
警告变成错误。我想。
John
I believe there have been discussions about preventing the clobbering
of builtins recently, so it may happen in the future (2.4?).
Dunno why None and not True / False causes a warning, but you can turn
warnings into errors using the warnings framework, I think.
John
这篇关于没有,错,真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!