diff --git a/README.md b/README.md index 7dd0807..9f116af 100644 --- a/README.md +++ b/README.md @@ -1957,18 +1957,21 @@ Memory View ```python = memoryview() - = [] # Can be int or float. + = [] # Returns an int or a float. = [] # Mview with rearranged elements. = .cast('') # Casts a memoryview to a new format. .release() # Releases the object's memory buffer. ``` ```python -.write() - = bytes() # Or: .tobytes() +.write() # Writes mview to a binary file. + = bytes() # Creates a new bytes object. = .join() # Joins mviews using bytes object as sep. - = list() # Returns numbers. Or: .tolist() - = str(, 'utf-8') # Or: .decode('utf-8') +``` + +```python + = list() # Returns list of ints or floats. + = str(, 'utf-8') = int.from_bytes(, byteorder='big|little', signed=False) '' = .hex() ``` diff --git a/index.html b/index.html index ed2b6dd..d4b60b8 100644 --- a/index.html +++ b/index.html @@ -1734,18 +1734,19 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,
  • Each element can reference a single or multiple consecutive bytes, depending on format.
  • Order and number of elements can be changed with slicing.
  • <mview> = memoryview(<bytes/bytearray/array>)
    -<num>   = <mview>[<index>]                     # Can be int or float.
    +<num>   = <mview>[<index>]                     # Returns an int or a float.
     <mview> = <mview>[<slice>]                     # Mview with rearranged elements.
     <mview> = <mview>.cast('<typecode>')           # Casts a memoryview to a new format.
     <mview>.release()                              # Releases the object's memory buffer.
     
    -
    <bin_file>.write(<mview>)
    -<bytes> = bytes(<mview>)                       # Or: <mview>.tobytes()
    +
    <bin_file>.write(<mview>)                      # Writes mview to a binary file.
    +<bytes> = bytes(<mview>)                       # Creates a new bytes object.
     <bytes> = <bytes>.join(<coll_of_mviews>)       # Joins mviews using bytes object as sep.
    -<list>  = list(<mview>)                        # Returns numbers. Or: <mview>.tolist()
    -<str>   = str(<mview>, 'utf-8')                # Or: <bytes>.decode('utf-8')
    +
    +
    <list>  = list(<mview>)                        # Returns list of ints or floats.
    +<str>   = str(<mview>, 'utf-8')
     <int>   = int.from_bytes(<mview>, byteorder='big|little', signed=False)
     '<hex>' = <mview>.hex()