assert , python -O ( , ). , , , - . , , zillion , - ( - ) ; ...
def firstargpos(f):
def wrapper(first, *args):
if first < 0:
raise ValueError(whateveryouwish)
return f(first, *args)
return wrapper
- :
@firstargpos def myfun (a, b): ...
(, , , ) . , - , (), ( , , , , ! -). , DRY ( "Do not Repeat Yourself" ) , Python , DRY , ! -)