[New-bugs-announce] [issue39753] inspecting a partial with bound keywods gives incorrect signature

Chris Withers report at bugs.python.org
Tue Feb 25 13:42:14 EST 2020


New submission from Chris Withers <chris at withers.org>:

$ python
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from functools import partial
>>> def foo(x, y, z, a=None): pass
... 
>>> p = partial(foo, 1, y=2)
>>> from inspect import signature
>>> signature(p).parameters.values()
odict_values([<Parameter "y=2">, <Parameter "z">, <Parameter "a=None">])

That <Parameter "y=2"> shouldn't be in there:

>>> p(2, y=3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: foo() got multiple values for argument 'y'

----------
messages: 362656
nosy: cjw296
priority: normal
severity: normal
status: open
title: inspecting a partial with bound keywods gives incorrect signature

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39753>
_______________________________________


More information about the New-bugs-announce mailing list