Created
November 10, 2011 14:55
-
-
Save herberthamaral/1355030 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def meu_decorador(f): | |
def funcao(*args): | |
print 'vem antes' | |
f(*args) | |
print 'vem depois' | |
return funcao | |
@meu_decorador | |
def teste(*args): | |
print args | |
teste(1,2,3) | |
""" | |
resposta: | |
vem antes | |
(1, 2, 3) | |
vem depois | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment