builtins自定义_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

|

| __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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值