d_skat

Untitled

Apr 6th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import sys
  2.  
  3.  
  4. def takes(*args):
  5.     def my_decorator(func):
  6.         def wrapped(*f_args):
  7.             if len(args) > len(f_args):
  8.                 for i in range(len(f_args)):
  9.                     if type(f_args[i]) != args[i]:
  10.                         raise TypeError
  11.             else:
  12.                 for i in range(len(args)):
  13.                     if type(f_args[i]) != args[i]:
  14.                         raise TypeError
  15.             return func(*f_args)
  16.         return wrapped
  17.     return my_decorator
  18.  
  19.  
  20. exec(sys.stdin.read())
Advertisement
Add Comment
Please, Sign In to add comment