Skip to content

Instantly share code, notes, and snippets.

@fereria
Last active June 8, 2016 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fereria/7356dc41355be7a3d783e6c8eb92175c to your computer and use it in GitHub Desktop.
Save fereria/7356dc41355be7a3d783e6c8eb92175c to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import inspect
def test_val(num):
def _deco(func):
def _func(*args, **kwargs):
print u"---func filepath---"
print inspect.getfile(func)
print u"---------------"
return func(*args, **kwargs)
return _func
return _deco
@test_val(10)
def aaa(a, b):
print 'hello world'
aaa(20, 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment