def __init__(self, radix=10, alphabet=BASE85):
        """basic validation and cached_map storage"""
        if int(radix) != radix:
            raise TypeError('radix must be an integer')
        if not 2 <= radix <= len(alphabet):
            raise ValueError('radix must be >= 2 and <= %d' % (
                len(alphabet), ))
        self.radix = radix
        self.alphabet = alphabet
        self.cached_map = dict(zip(self.alphabet, range(len(self.alphabet))))
        if len(self.cached_map) != len(self.alphabet):
            raise ValueError("duplicate characters found in '%s'" % (
                self.alphabet, ))
def __init__ ( self , radix = 10 , alphabet = BASE85 ) : if int ( radix ) != radix : raise TypeError ( 'radix must be an integer' ) if not 2 <= radix <= len ( alphabet ) : raise ValueError ( 'radix must be >= 2 and <= %d' % ( len ( alphabet ) , ) ) self . radix = radix self . alphabet = alphabet self . cached_map = dict ( zip ( self . alphabet , range ( len ( self . alphabet ) ) ) ) if len ( self . cached_map ) != len ( self . alphabet ) : raise ValueError ( "duplicate characters found in '%s'" % ( self . alphabet , ) )
basic validation and cached_map storage