码迷,mamicode.com
首页 > 其他好文 > 详细

内置常量

时间:2018-06-02 12:56:40      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:option   not   -o   img   int   info   tar   http   tran   

在内置命名空间中存在少量的变量:

(1)False:false值为布尔类型,参数赋值false会引发语法错误

(2)True:true值为布尔类型,参数赋值false会引发语法错误

(3)None:NoneType类型. None通常表示为没有值(值的缺失),例如:当默认参数没有传递时. 给none赋值会引发语法错误.

(4)NotImplemented:

(5)Ellipsis:相当于...,常与切片组合使用.

例如:

技术分享图片

(6)__debug__:This constant is true if Python was not started with an -O option

 注意:变量: NoneFalseTrue and __debug__ 不能被赋值,否则引发错误, 所以他们应当被考虑为"真值"常量.

内置常量

标签:option   not   -o   img   int   info   tar   http   tran   

原文地址:https://www.cnblogs.com/cangshuchirou/p/9125039.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!