Skip to content
Snippets Groups Projects
Commit 67d55b9b authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

6

parent dceee150
No related branches found
No related tags found
No related merge requests found
...@@ -477,14 +477,14 @@ def checked_coerce(*t_args, **t_kwargs): ...@@ -477,14 +477,14 @@ def checked_coerce(*t_args, **t_kwargs):
def for_argument(*t_ops, **t_kwops): def for_argument(*t_ops, **t_kwops):
t_ops = [None for op in t_ops if op == 'self'] t_ops = [__NOP if op == 'self' else op for op in t_ops]
def outer(fun): def outer(fun):
@functools.wraps(fun) @functools.wraps(fun)
def inner(*args, **kwargs): def inner(*args, **kwargs):
# add extra 'None' argument if unbound method # add extra 'None' argument if unbound method
assert len(args) >= len(t_ops) assert len(args) >= len(t_ops)
return fun(*((op or __NOP)(arg) for arg, op in six.moves.zip_longest(args, t_ops)), return fun(*((__NOP if op is None else op)(arg) for arg, op in six.moves.zip_longest(args, t_ops)),
**{k: t_kwops.get(k, __NOP)(v) for k, v in kwargs.items()}) **{k: t_kwops.get(k, __NOP)(v) for k, v in kwargs.items()})
return inner return inner
return outer return outer
[metadata] [metadata]
name = satella name = satella
version = 2.0.19rc5 version = 2.0.19rc6
description-file = README.md description-file = README.md
author = Piotr Maślanka author = Piotr Maślanka
author_email = piotrm@smok.co author_email = piotrm@smok.co
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment