pybit/py3/common.py
def map_var(self,
                pr: int=False) -> Tuple[int, bytes]:
        """Find the indexes of the next (variable) data locations."""
        # Get the next byte
        index = self.cursor
        by = self.read_next(1)
        o = ord(by)

        if pr:
            print(by)

        if o < 253:
            # Return as is
            # by is already int here
            out = by
            index = (index, index + 1)
        elif o == 253:  # 0xfd
            # Read next 2 bytes
            # Reverse endedness
            # Convert to int in base 16
            out = self.map_next(2)
            index = (index, index + 1 + 2)
        elif o == 254:  # 0xfe
            # Read next 4 bytes, convert as above
            out = self.map_next(4)
            index = (index, index + 1 + 4)
        elif o == 255:  # 0xff
            # Read next 8 bytes, convert as above
            out = self.map_next(8)
            index = (index, index + 1 + 8)

        if pr:
            print(out)

        return index, out
Find the indexes of the next (variable) data locations.
Find the indexes of the next (variable) data locations.
Find the indexes of the next ( variable ) data locations .
def map_var(self,
                pr: int=False) -> Tuple[int, bytes]:
        index = self.cursor
        by = self.read_next(1)
        o = ord(by)
        if pr:
            print(by)
        if o < 253:
            out = by
            index = (index, index + 1)
        elif o == 253:  
            out = self.map_next(2)
            index = (index, index + 1 + 2)
        elif o == 254:  
            out = self.map_next(4)
            index = (index, index + 1 + 4)
        elif o == 255:  
            out = self.map_next(8)
            index = (index, index + 1 + 8)
        if pr:
            print(out)
        return index, out
def map_var ( self , pr : int = False ) -> Tuple [ int , bytes ] : index = self . cursor by = self . read_next ( 1 ) o = ord ( by ) if pr : print ( by ) if o < 253 : out = by index = ( index , index + 1 ) elif o == 253 : out = self . map_next ( 2 ) index = ( index , index + 1 + 2 ) elif o == 254 : out = self . map_next ( 4 ) index = ( index , index + 1 + 4 ) elif o == 255 : out = self . map_next ( 8 ) index = ( index , index + 1 + 8 ) if pr : print ( out ) return index , out
Find the indexes of the next (variable) data locations.
Find the indexes of the next ( variable ) data locations .
"""Find the indexes of the next (variable) data locations.""" # Get the next byte # Return as is # by is already int here # 0xfd # Read next 2 bytes # Reverse endedness # Convert to int in base 16 # 0xfe # Read next 4 bytes, convert as above # 0xff # Read next 8 bytes, convert as above
self
pr
int