Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # from numba import jit
- def decorator_maker(*arg):
- print('decor args:' + str(arg))
- def my_decorator(func):
- def wrapped(*args, **kwargs):
- print('func arg:' + str(args))
- print('start')
- return func(*args)
- return wrapped
- return my_decorator
- @decorator_maker(1)
- def decorated_func(a):
- print ('func inside')
- decorated_lambda = decorator_maker(3)(lambda x: x+1)
- # decorated_lambda2 = jit(nopython=True)(lambda x: x+1)
- if __name__ == '__main__':
- decorated_func(2)
- decorated_lambda(0)
- # decorated_lambda2(5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement