(self, settings={})
Register function mappings supplied by user
Register function mappings supplied by user
Register function mappings supplied by user
def __init__(self, settings={}):
        """Register function mappings supplied by user"""
        CodePrinter.__init__(self, settings)
        self.known_functions = dict(known_functions)
        userfuncs = settings.get('user_functions', {})
        for k, v in userfuncs.items():
            if not isinstance(v, list):
                userfuncs[k] = [(lambda *x: True, v)]
        self.known_functions.update(userfuncs)
def __init__ ( self , settings = { } ) : CodePrinter . __init__ ( self , settings ) self . known_functions = dict ( known_functions ) userfuncs = settings . get ( 'user_functions' , { } ) for k , v in userfuncs . items ( ) : if not isinstance ( v , list ) : userfuncs [ k ] = [ ( lambda * x : True , v ) ] self . known_functions . update ( userfuncs )