forge icon indicating copy to clipboard operation
forge copied to clipboard

Naming conflict with positional arguments and others.

Open Xeite opened this issue 5 years ago • 0 comments

First of all, thanks for amazing library.

I found positional arguments conflict to others, and implementation tracked all parameter name using set.

>>> import forge
>>> sigs = [forge.pos('a'), forge.kwo('a')]
>>> def hello(*args, **kargs):
...     pass
...
>>> forge.sign(*sigs)(hello)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yan/ITF/kfra/.venv/lib/python3.6/site-packages/forge/_revision.py", line 330, in __call__
    next_.validate()
  File "/Users/yan/ITF/kfra/.venv/lib/python3.6/site-packages/forge/_signature.py", line 1328, in validate
    format(current.name)
ValueError: Received multiple parameters with name 'a'

imho, user does not care about the name of positional argument since they could not use it like keyword parameter. So how about letting user use two same name for positional argument?

Thanks.

Xeite avatar Jul 01 '19 06:07 Xeite