python built-in constants


python内置常量

False

bool类型的假值,python3中,False作为一个关键字不能被赋值,赋值是非法的,会报语法错误:

In [1]: False = 0
  File "<ipython-input-1-389dfc15b373>", line 1
    False = 0
             ^
SyntaxError: can't assign to keyword

True

同False一样,bool类型的真值,python3中,True作为一个关键字不能被赋值,赋值是非法的,会报语法错误:

In [1]: True = 1
  File "<ipython-input-2-11e39cdf8368>", line 1
    True = 1
            ^
SyntaxError: can't assign to keyword

None

NoneType类型的唯一返回值,None通常被用来表示一个值得缺失,同样也不能被赋值

In [1]: None = []
  File "<ipython-input-4-263c1fbabdb8>", line 1
    None = []
             ^
SyntaxError: can't assign to keyword

NotImplemented

Ellipsis

__debug__

如果不是以-o运行python,返回True

quit(code=Node)

exit(code=None)

In [1]: copyright
Out[1]:
Copyright (c) 2001-2016 Python Software Foundation.
All Rights Reserved.

Copyright (c) 2000 BeOpen.com.
All Rights Reserved.

Copyright (c) 1995-2001 Corporation for National Research Initiatives.
All Rights Reserved.

Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.
All Rights Reserved.

license

In [1]: license
Out[1]: Type license() to see the full license text


In [2]: license()
A. HISTORY OF THE SOFTWARE
==========================

Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC.  Guido remains Python's
principal author, although it includes many contributions from others.

In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.

In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
year, the PythonLabs team moved to Digital Creations (now Zope
Corporation, see http://www.zope.com).  In 2001, the Python Software
Foundation (PSF, see http://www.python.org/psf/) was formed, a
non-profit organization created specifically to own Python-related
Intellectual Property.  Zope Corporation is a sponsoring member of
the PSF.

All Python releases are Open Source (see http://www.opensource.org for
Hit Return for more, or q (and Return) to quit:

credits

In [1]: credits
Out[1]:
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.

文章作者: keepwonder
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 keepwonder !
  目录