Skip to content

Instantly share code, notes, and snippets.

@vi4m
Last active August 29, 2015 14:16
Show Gist options
  • Save vi4m/c61b48699f5b5c885daf to your computer and use it in GitHub Desktop.
Save vi4m/c61b48699f5b5c885daf to your computer and use it in GitHub Desktop.
exam-1

Beautifull function decorator

Write decorator which prints function arguments and result. When decorated on given function with arbitrary number of arguments, invocation of this function should print-out arguments, and the result.

    @deco
    def sum_(x, y):
        return x + y
> sum_(1, 3)
Result of function sum_ on params: 1 and 3 is 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment