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

      

  • 相关阅读:
    RabbitMQ架构面试题答不出来怎么办!大佬手绘架构图带你分分钟搞懂!
    【秋招必备】大数据面试题100道(2021最新版)
    【秋招必备】设计模式面试题(2021最新版)
    【秋招必备】TCP,UDP,Socket,Http网络编程面试题(2021最新版)
    3分钟带你玩转MySQL体系结构和查询原理!
    易车面试官:说说MySQL内存结构、索引、集群、底层原理!
    【秋招必备】Mybatis面试题(2021最新版)
    iOS-项目开发1
    ReactNatvie遇到的错误
    细节
  • 原文地址:https://www.cnblogs.com/gundan/p/8257240.html
Copyright © 2020-2023  润新知