Author Antony.Lee
Recipients Antony.Lee
Date 2018-04-01.07:14:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za>
In-reply-to
Content
Python 3.6.4

    In [15]: inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42)
    ---------------------------------------------------------------------------
    ValueError                                Traceback (most recent call last)
    <ipython-input-15-7ed8c4fd15f3> in <module>()
    ----> 1 inspect.Parameter("foo", kind=inspect.Parameter.VAR_KEYWORD, default=42)

    /usr/lib/python3.6/inspect.py in __init__(self, name, kind, default, annotation)
    2442             if kind in (_VAR_POSITIONAL, _VAR_KEYWORD):
    2443                 msg = '{} parameters cannot have default values'.format(kind)
    -> 2444                 raise ValueError(msg)
    2445         self._default = default
    2446         self._annotation = annotation

    ValueError: 4 parameters cannot have default values

Note the "interesting" error message that starts with "4 parameters ..." (yes, I guess that inspect.Parameter == 4 internally...).

Probably just a matter of making the error f'{kind.name} parameters ...'.
History
Date User Action Args
2018-04-01 07:14:32Antony.Leesetrecipients: + Antony.Lee
2018-04-01 07:14:32Antony.Leesetmessageid: <1522566872.11.0.467229070634.issue33197@psf.upfronthosting.co.za>
2018-04-01 07:14:32Antony.Leelinkissue33197 messages
2018-04-01 07:14:31Antony.Leecreate