python __builtins__ bool类 (6)
6、'bool', 函数用于将给定参数转换为布尔类型,如果没有参数,返回 False。
class bool(int) # 继承于int类型
| bool(x) -> bool # 创建bool类型的对象
|
| Returns True when the argument x is true, False otherwise. # 参数x为真返回True,否则返回False。
| The builtins True and False are the only two instances of the class bool. # 内置True和False是仅有的2个bool类型的实例。
| The class bool is a subclass of the class int, and cannot be subclassed. # bool类是int类的子类,不能被继承。
|
| Method resolution order: # MRO-方法解析顺序
| bool
| int
| object
|
| Methods defined here:
|
| __and__(self, value, /)
| Return self&value.
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| __or__(self, value, /)
| Return self|value.
|
| __rand__(self, value, /)
| Return value&self.
|
| __repr__(self, /)
| Return repr(self).
|
| __ror__(self, value, /)
| Return value|self.
|
| __rxor__(self, value, /)
| Return value^self.
|
| __str__(self, /)
| Return str(self).
|
| __xor__(self, value, /)
| Return self^value.
|
| ----------------------------------------------------------------------
| Methods inherited from int:
|
| __abs__(self, /)
| abs(self)
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| self != 0
|
| __ceil__(...)
| Ceiling of an Integral returns itself.
|
| __divmod__(self, value, /)
| Return divmod(self, value).
|
| __eq__(self, value, /)
| Return self==value.
|
| __float__(self, /)
| float(self)
|
| __floor__(...)
| Flooring an Integral returns itself.
|
| __floordiv__(self, value, /)
| Return self//value.
|
| __format__(...)
| default object formatter
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getnewargs__(...)
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __index__(self, /)
| Return self converted to an integer, if self is suitable for use as an index into a list.
|
| __int__(self, /)
| int(self)
|
| __invert__(self, /)
| ~self
|
| __le__(self, value, /)
| Return self<=value.
|
| __lshift__(self, value, /)
| Return self<<value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mod__(self, value, /)
| Return self%value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __neg__(self, /)
| -self
|
| __pos__(self, /)
| +self
|
| __pow__(self, value, mod=None, /)
| Return pow(self, value, mod).
|
| __radd__(self, value, /)
| Return value+self.
|
| __rdivmod__(self, value, /)
| Return divmod(value, self).
|
| __rfloordiv__(self, value, /)
| Return value//self.
|
| __rlshift__(self, value, /)
| Return value<<self.
|
| __rmod__(self, value, /)
| Return value%self.
|
| __rmul__(self, value, /)
| Return value*self.
|
| __round__(...)
| Rounding an Integral returns itself.
| Rounding with an ndigits argument also returns an integer.
|
| __rpow__(self, value, mod=None, /)
| Return pow(value, self, mod).
|
| __rrshift__(self, value, /)
| Return value>>self.
|
| __rshift__(self, value, /)
| Return self>>value.
|
| __rsub__(self, value, /)
| Return value-self.
|
| __rtruediv__(self, value, /)
| Return value/self.
|
| __sizeof__(...)
| Returns size in memory, in bytes
|
| __sub__(self, value, /)
| Return self-value.
|
| __truediv__(self, value, /)
| Return self/value.
|
| __trunc__(...)
| Truncating an Integral returns itself.
|
| bit_length(...)
| int.bit_length() -> int
|
| Number of bits necessary to represent self in binary.
| >>> bin(37)
| '0b100101'
| >>> (37).bit_length()
| 6
|
| conjugate(...)
| Returns self, the complex conjugate of any int.
|
| from_bytes(...) from builtins.type
| int.from_bytes(bytes, byteorder, *, signed=False) -> int
|
| Return the integer represented by the given array of bytes.
|
| The bytes argument must be a bytes-like object (e.g. bytes or bytearray).
|
| The byteorder argument determines the byte order used to represent the
| integer. If byteorder is 'big', the most significant byte is at the
| beginning of the byte array. If byteorder is 'little', the most
| significant byte is at the end of the byte array. To request the native
| byte order of the host system, use `sys.byteorder' as the byte order value.
|
| The signed keyword-only argument indicates whether two's complement is
| used to represent the integer.
|
| to_bytes(...)
| int.to_bytes(length, byteorder, *, signed=False) -> bytes
|
| Return an array of bytes representing an integer.
|
| The integer is represented using length bytes. An OverflowError is
| raised if the integer is not representable with the given number of
| bytes.
|
| The byteorder argument determines the byte order used to represent the
| integer. If byteorder is 'big', the most significant byte is at the
| beginning of the byte array. If byteorder is 'little', the most
| significant byte is at the end of the byte array. To request the native
| byte order of the host system, use `sys.byteorder' as the byte order value.
|
| The signed keyword-only argument determines whether two's complement is
| used to represent the integer. If signed is False and a negative integer
| is given, an OverflowError is raised.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from int:
|
| denominator
| the denominator of a rational number in lowest terms
|
| imag
| the imaginary part of a complex number
|
| numerator
| the numerator of a rational number in lowest terms
|
| real
| the real part of a complex number
python __builtins__ bool类 (6)的更多相关文章
- python __builtins__ memoryview类 (46)
46.'memoryview', 返回给定参数的内存查看对象(Momory view).所谓内存查看对象,是指对支持缓冲区协议的数据进行包装,在不需要复制对象基础上允许Python代码访问. cla ...
- python __builtins__ type类 (69)
69.'type', 返回对象类型 class type(object) | type(object_or_name, bases, dict) | type(object) -> the ob ...
- python __builtins__ str类 (65)
65.'str', 字节转换成字符串.第一个传入参数是要转换的字节,第二个参数是按什么编码转换成字符串 class str(object) | str(object='') -> str | s ...
- python __builtins__ staticmethod类 (64)
64.'staticmethod', 返回静态方法 class staticmethod(object) | staticmethod(function) -> method | | Conve ...
- python __builtins__ help类 (32)
32.'help', 接收对象作为参数,更详细地返回该对象的所有属性和方法 class _Helper(builtins.object) | Define the builtin 'help'. | ...
- python __builtins__ float类 (25)
25.'float', 用于将整数和字符串转换成浮点数. class float(object) | float(x) -> floating point number | | Convert ...
- python __builtins__ classmethod类 (11)
11.'classmethod', 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等. class cla ...
- python __builtins__ bytes类 (8)
8.'bytes', 字符串转换成字节流.第一个传入参数是要转换的字符串,第二个参数按什么编码转换为字节. class bytes(object) | bytes(iterable_of_ints) ...
- python __builtins__ bytearray类 (7)
7.'bytearray', 返回一个新字节数组.这个数组里的元素是可变的,并且每个元素的值范围: 0 <= x < 256. class bytearray(object) | byte ...
随机推荐
- Bootstrap的表单控件
支持的表单控件 Bootstrap 支持最常见的表单控件,主要是 input.textarea.checkbox.radio 和 select. 输入框(Input) 最常见的表单文本字段是输入框 i ...
- WMS8_仓库配置
仓库划分为不同的区域,比如收货区,出货区,库存区,这些区域在odoo中称之为库位[location],库位可以上下嵌套,形成一个树状的层级关系. 库位分为不同的类型 物理库存位置[Physical s ...
- 按字节寻址and按字编址
按字节寻址,存储空间的最小编址单位是字节,按字编址,存储空间的最小编址单位是字,最小编址单位的选择,和存储容量.地址总线宽度都有关联 .同样的存储容量, 粒度小了,地址长度就需要更长 .就是根据不同的 ...
- 时间格式 2016-08-15T16:00:00.000Z
我修改的时间是2016-08-16(转换成Date后默认为2016-08-16 00:00:00),而我得到的时间却是2016-08-15T16:00:00.000Z 联想到我们当前的时区是+8区 ...
- 【转载】VS工具使用——代码图
代码图: 心想,反正也调不出来,就试试这个东西吧,一打开,就认识到自己发现了一个新大陆:这个代码图可以让我们对一个工程文件有大体的了解,即函数的调用关系等.它是一个VS2013自带工具生成函数 ...
- 项目记录26--unity-tolua框架 View03-UIManager.lua
做为程序员要懂得假设保持健康,对电脑时间太长非常easy眼花,得脖子病,腰都疼,这星期六日组团到康宁去了,哈哈. 一个字"疼"!!!! 废话不多少,把UIManager.lua个搞 ...
- iOS之UI--使用SWRevealViewController 实现侧边菜单功能详解实例
iOS之UI--使用SWRevealViewController 实现侧边菜单功能详解实例 使用SWRevealViewController实现侧边菜单功能详解 下面通过两种方法详解SWReveal ...
- UltraEdit中使用正则表达式-简单用法
UltraEdit中使用正则表达式 1.认识正则表达式语法: 正则表达式 (UltraEdit Syntax): % 匹配行首 - 表明要搜索的字符串一定在行首. $ 匹配行尾 - 表明要搜索的字符串 ...
- dp求顺序hdu1160
题意是仅仅求一次的顺序.先依照速度从大到小排序,速度想等到按体重增序排列. 然后基本就变成了求已定顺序序列的最长递增序列递增,跟那个求一致最大序列和的基本一致. dp[i]里存储的是到当前i最大的递增 ...
- 20170225 ABAP获取字符串长度/字节长度
函数YGET_CHAR_LONG: FUNCTION YGET_CHAR_LONG. *"-------------------------------------------------- ...