python __builtins__ memoryview类 (46)
46、'memoryview', 返回给定参数的内存查看对象(Momory view)。所谓内存查看对象,是指对支持缓冲区协议的数据进行包装,在不需要复制对象基础上允许Python代码访问。
class memoryview(object)
| Create a new memoryview object which references the given object.
|
| Methods defined here:
|
| __delitem__(self, key, /)
| Delete self[key].
|
| __enter__(...)
|
| __eq__(self, value, /)
| Return self==value.
|
| __exit__(...)
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getitem__(self, key, /)
| Return self[key].
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __len__(self, /)
| Return len(self).
|
| __lt__(self, value, /)
| Return self<value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| __repr__(self, /)
| Return repr(self).
|
| __setitem__(self, key, value, /)
| Set self[key] to value.
|
| cast(self, /, format, *, shape)
| Cast a memoryview to a new format or shape.
|
| hex(self, /)
| Return the data in the buffer as a string of hexadecimal numbers.
|
| release(self, /)
| Release the underlying buffer exposed by the memoryview object.
|
| tobytes(self, /)
| Return the data in the buffer as a byte string.
|
| tolist(self, /)
| Return the data in the buffer as a list of elements.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| c_contiguous
| A bool indicating whether the memory is C contiguous.
|
| contiguous
| A bool indicating whether the memory is contiguous.
|
| f_contiguous
| A bool indicating whether the memory is Fortran contiguous.
|
| format
| A string containing the format (in struct module style)
| for each element in the view.
|
| itemsize
| The size in bytes of each element of the memoryview.
|
| nbytes
| The amount of space in bytes that the array would use in
| a contiguous representation.
|
| ndim
| An integer indicating how many dimensions of a multi-dimensional
| array the memory represents.
|
| obj
| The underlying object of the memoryview.
|
| readonly
| A bool indicating whether the memory is read only.
|
| shape
| A tuple of ndim integers giving the shape of the memory
| as an N-dimensional array.
|
| strides
| A tuple of ndim integers giving the size in bytes to access
| each element for each dimension of the array.
|
| suboffsets
| A tuple of integers used internally for PIL-style arrays.
python __builtins__ memoryview类 (46)的更多相关文章
- 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__ bool类 (6)
6.'bool', 函数用于将给定参数转换为布尔类型,如果没有参数,返回 False. class bool(int) # 继承于int类型 | bool(x) -> bool # 创建boo ...
- python __builtins__ zip类 (71)
71.'zip' , 函数用于将可迭代的对象作为参数,将对象中对应的元素打包成一个个元组,然后返回由这些元组组成的列表.如果各个迭代器的元素个数不一致,则返回列表长度与最短的对象相同,利用 * 号操作 ...
- python __builtins__ type类 (69)
69.'type', 返回对象类型 class type(object) | type(object_or_name, bases, dict) | type(object) -> the ob ...
- python __builtins__ tuple类 (68)
68.'tuple', 转换为元组类型 class tuple(object) | tuple() -> empty tuple | tuple(iterable) -> tuple in ...
- python __builtins__ str类 (65)
65.'str', 字节转换成字符串.第一个传入参数是要转换的字节,第二个参数是按什么编码转换成字符串 class str(object) | str(object='') -> str | s ...
随机推荐
- push代码到github时,每次都要输入用户名和密码的问题
问题原由 我在Github上 建立了一个小项目TauStreamingServer,可是在每次push代码 的时候,都要求输入用户名和密码,很是麻烦. 如何才能避免每次都输入用户名和密码呢? 解决办法 ...
- ios NSAttributedString 具体解释
ios NSAttributedString 具体解释 NSAttributedString能够让我们使一个字符串显示的多样化,可是眼下到iOS 5为止,好像对它支持的不是非常好,由于显示起来不太方便 ...
- RC4算法的Python实现详注
刚对RC4算法进行了学习,网上发现https://ju.outofmemory.cn/entry/46753 中作者展示了RC4的python实现,但代码缺乏注释,较为晦涩,因此本文对部分代码进行了注 ...
- ubuntu搭建samba服务器
一.为什么要用Samba? Samba的主要任务就是实现Linux系统和Windows系统之间的资源共享. 二.需要的软件? 我是在ubuntu上实现的,所以我只需在配置好ubuntu的更 ...
- 一个简单的EBNF范式的实现
最近无事在看书的时候发现了这个东西刹那间突然觉得大学时候编译原理书上的的什么语法分析书.上下文无关等晦涩难懂的概念清晰了许多今天把它贴出来希望也能让你回想起些往事... 至于EBNF范式是什么东西,网 ...
- Android 返回键的处理
多网友不明确怎样在Android平台上捕获Back键的事件.Back键是手机上的后退键,一般的软件不捕获相关信息可能导致你的程序被切换到后台.而回到桌面的尴尬情况,在Android上有两种方法来获取该 ...
- 20170225-第一件事:SAP模块清单
第一件事:SAP模块清单 AM 资产会计 资产会计BC SAP Netweaver SAP NetweaverBW 业务信息仓库 业务信息仓库CA 常规跨应用程序 常规跨越应用程序CO 控制 控制 C ...
- C++使用模板、函数指针、接口和lambda表达式这四种方法做回调函数的区别比较
在C++中,两个类之间存在一种关系,某个类需要另外一个类去完成某一个功能,完成了之后需要告知该类结果,这种最普通最常见的需求,往往使用回调函数来解决. 如题,我总结下来有这么四种方式可以完成这项功能, ...
- SWT 安装
下载地址: http://www.eclipse.org/windowbuilder/download.php 看到页面如下:选择图片标记的 3.7 (Indigo) update site lin ...
- @SpringBootApplication 注解
@SpringBootApplication 启动类注解(一般在root下):该注解被@Configuration.@EnableAutoConfiguration.@ComponentScan 这三 ...