diff --git a/README.md b/README.md index aed668d..f8fed70 100644 --- a/README.md +++ b/README.md @@ -1912,16 +1912,16 @@ Bytes ```python = bytes() # Ints must be in range from 0 to 255. = bytes(, 'utf-8') # Or: .encode('utf-8') - = .to_bytes(n_bytes, byteorder='big/little', signed=False) - = bytes.fromhex('') + = .to_bytes(n_bytes) # Also: `byteorder='big/little', signed=False`. + = bytes.fromhex('') # Hex numbers can be separated by spaces. ``` ### Decode ```python = list() # Returns ints in range from 0 to 255. = str(, 'utf-8') # Or: .decode('utf-8') - = int.from_bytes(, byteorder='big/little', signed=False) -'' = .hex() + = int.from_bytes() # Also: `byteorder='big/little', signed=False`. +'' = .hex() # Returns a string of hexadecimal numbers. ``` ### Read Bytes from File @@ -2011,10 +2011,13 @@ Memory View = bytes() # Creates a new bytes object. = .join() # Joins mviews using bytes object as sep. = array('', ) # Treats mview as a sequence of numbers. +``` + +```python = list() # Returns list of ints or floats. = str(, 'utf-8') # Treats mview as a bytes object. - = int.from_bytes(, byteorder='big/little', signed=False) -'' = .hex() + = int.from_bytes(, …) # `byteorder='big/little', signed=False`. +'' = .hex() # Treats mview as a bytes object. ``` diff --git a/index.html b/index.html index c9770f1..2cda4b3 100644 --- a/index.html +++ b/index.html @@ -1701,14 +1701,14 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,

Encode

<bytes> = bytes(<coll_of_ints>)          # Ints must be in range from 0 to 255.
 <bytes> = bytes(<str>, 'utf-8')          # Or: <str>.encode('utf-8')
-<bytes> = <int>.to_bytes(n_bytes, byteorder='big/little', signed=False)
-<bytes> = bytes.fromhex('<hex>')
+<bytes> = <int>.to_bytes(n_bytes)        # Also: `byteorder='big/little', signed=False`.
+<bytes> = bytes.fromhex('<hex>')         # Hex numbers can be separated by spaces.
 

Decode

<list>  = list(<bytes>)                  # Returns ints in range from 0 to 255.
 <str>   = str(<bytes>, 'utf-8')          # Or: <bytes>.decode('utf-8')
-<int>   = int.from_bytes(<bytes>, byteorder='big/little', signed=False)
-'<hex>' = <bytes>.hex()
+<int>   = int.from_bytes(<bytes>)        # Also: `byteorder='big/little', signed=False`.
+'<hex>' = <bytes>.hex()                  # Returns a string of hexadecimal numbers.
 

Read Bytes from File

def read_bytes(filename):
@@ -1782,12 +1782,13 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,
 <bytes> = bytes(<mview>)                       # Creates a new bytes object.
 <bytes> = <bytes>.join(<coll_of_mviews>)       # Joins mviews using bytes object as sep.
 <array> = array('<typecode>', <mview>)         # Treats mview as a sequence of numbers.
-<list>  = list(<mview>)                        # Returns list of ints or floats.
-<str>   = str(<mview>, 'utf-8')                # Treats mview as a bytes object.
-<int>   = int.from_bytes(<mview>, byteorder='big/little', signed=False)
-'<hex>' = <mview>.hex()
 
+
<list>  = list(<mview>)                        # Returns list of ints or floats.
+<str>   = str(<mview>, 'utf-8')                # Treats mview as a bytes object.
+<int>   = int.from_bytes(<mview>, …)           # `byteorder='big/little', signed=False`.
+'<hex>' = <mview>.hex()                        # Treats mview as a bytes object.
+

#Deque

A thread-safe list with efficient appends and pops from either side. Pronounced "deck".

from collections import deque
 <deque> = deque(<collection>, maxlen=None)