python __builtins__ tuple类 (68)】的更多相关文章

68.'tuple', 转换为元组类型 class tuple(object) | tuple() -> empty tuple | tuple(iterable) -> tuple initialized from iterable's items | | If the argument is a tuple, the return value is the same object. | | Methods defined here: | | __add__(self, value, /)…
46.'memoryview',  返回给定参数的内存查看对象(Momory view).所谓内存查看对象,是指对支持缓冲区协议的数据进行包装,在不需要复制对象基础上允许Python代码访问. class memoryview(object) | Create a new memoryview object which references the given object. | | Methods defined here: | | __delitem__(self, key, /) | De…
71.'zip' , 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表.如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 * 号操作符,可以将元组解压为列表. class zip(object) | zip(iter1 [,iter2 [...]]) --> zip object | | Return a zip object whose .__next__() method returns a tuple where | th…
65.'str', 字节转换成字符串.第一个传入参数是要转换的字节,第二个参数是按什么编码转换成字符串 class str(object) | str(object='') -> str | str(bytes_or_buffer[, encoding[, errors]]) -> str | | Create a new string object from the given object. If encoding or | errors is specified, then the ob…
64.'staticmethod', 返回静态方法 class staticmethod(object) | staticmethod(function) -> method | | Convert a function to be a static method. | | A static method does not receive an implicit first argument. | To declare a static method, use this idiom: | | c…
32.'help', 接收对象作为参数,更详细地返回该对象的所有属性和方法 class _Helper(builtins.object) | Define the builtin 'help'. | | This is a wrapper around pydoc.help that provides a helpful message | when 'help' is typed at the Python interactive prompt. | | Calling help() at t…
25.'float', 用于将整数和字符串转换成浮点数. class float(object) | float(x) -> floating point number | | Convert a string or number to a floating point number, if possible. | | Methods defined here: | | __abs__(self, /) | abs(self) | | __add__(self, value, /) | Retu…
11.'classmethod', 修饰符对应的函数不需要实例化,不需要 self 参数,但第一个参数需要是表示自身类的 cls 参数,可以来调用类的属性,类的方法,实例化对象等. class classmethod(object) | classmethod(function) -> method | | Convert a function to be a class method. # 将一个函数转换成类方法 | | A class method receives the class as…
8.'bytes', 字符串转换成字节流.第一个传入参数是要转换的字符串,第二个参数按什么编码转换为字节. class bytes(object) | bytes(iterable_of_ints) -> bytes # bytes([1, 2, 3, 4]) bytes must be in range(0, 256) | bytes(string, encoding[, errors]) -> bytes # bytes('你妈嗨', encoding='utf-8') | bytes(b…
7.'bytearray', 返回一个新字节数组.这个数组里的元素是可变的,并且每个元素的值范围: 0 <= x < 256. class bytearray(object) | bytearray(iterable_of_ints) -> bytearray # 元素必须为[0 ,255] 中的整数 | bytearray(string, encoding[, errors]) -> bytearray # 按照指定的 encoding 将字符串转换为字节序列 | bytearr…