Decorator Class

    0

    13

    Daniel Slaughter

    Shortcut: decorator.class

    class ClassName:
        def __init__(self, decorated):
          self._decorated = decorated
    
        def __call__(self, *args):
          __returned__ = self._decorated(*args)
          return Extendedfunctionality 
    
    
    @ClassName
    def DecoratedFunction(*args):
        return Initialfunctionality 
    
    
    print(DecoratedFunction)
    print(DecoratedFunction(args))
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.