(self, param)
return lambda x: decorator(param, x)
Decorator to register a function or class.
Decorator to register a function or class.
Decorator to register a function or class .
def register(self, param):
    """Decorator to register a function or class."""

    def decorator(key, value):
      self[key] = value
      return value

    if callable(param):
      # @reg.register
      return decorator(None, param)
    # @reg.register('alias')
    return lambda x: decorator(param, x)
def register ( self , param ) : def decorator ( key , value ) : self [ key ] = value return value if callable ( param ) : # @reg.register return decorator ( None , param ) # @reg.register('alias') return lambda x : decorator ( param , x )