Advertisement
d_skat

Untitled

Apr 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. import sys
  2. import functools
  3.  
  4.  
  5. def takes(*args):
  6.     myargs = args
  7.  
  8.     def take(func):
  9.  
  10.         @functools.wraps(func)
  11.         def wrapper(*args):
  12.  
  13.             for a, b in zip(myargs, args):
  14.                 if(not isinstance(b, a)):
  15.                     raise TypeError
  16.             return func(*args)
  17.  
  18.         return wrapper
  19.     return take
  20.  
  21.  
  22. exec(sys.stdin.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement