smpl_util.util.rename

smpl_util.util.rename(old, new, warning=True)[source]

Annotation to replace the name of a function argument.

Examples

>>> @rename("a","b")
... def f(b):
...     return b
>>> f(1)
1
>>> f(a=1)
1
>>> f(b=1)
1
>>> f(b=2,a=1)
2