Skip to content

Instantly share code, notes, and snippets.

@rahulkp220
Created June 26, 2016 15:16
Show Gist options
  • Select an option

  • Save rahulkp220/afb7d3dec788fe725f72d7324f8e4343 to your computer and use it in GitHub Desktop.

Select an option

Save rahulkp220/afb7d3dec788fe725f72d7324f8e4343 to your computer and use it in GitHub Desktop.

Revisions

  1. rahulkp220 created this gist Jun 26, 2016.
    10 changes: 10 additions & 0 deletions Simpler_decorator.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    def double(function):
    def wrapper(*args,**kwargs):
    return 2 * function(*args,**kwargs)
    return wrapper

    @double
    def adder(x,y):
    return x + y

    print adder(1,3)