Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- def takes(*args):
- def my_decorator(func):
- def wrapped(*f_args):
- if len(args) > len(f_args):
- for i in range(len(f_args)):
- if type(f_args[i]) != args[i]:
- raise TypeError
- else:
- for i in range(len(args)):
- if type(f_args[i]) != args[i]:
- raise TypeError
- return func(*f_args)
- return wrapped
- return my_decorator
- exec(sys.stdin.read())
Advertisement
Add Comment
Please, Sign In to add comment