This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Oren Milman
Recipients Oren Milman
Date 2017-08-18.21:51:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1503093079.31.0.160974520345.issue31236@psf.upfronthosting.co.za>
In-reply-to
Content
currently, we have the following:
    >>> min(0, a=1)
    TypeError: 'a' is an invalid keyword argument for this function
    >>> max(0, a=1)
    TypeError: 'a' is an invalid keyword argument for this function
    >>> max(0, a=1, b=2, c=3)
    TypeError: function takes at most 2 arguments (3 given)
    >>> min(0, a=1, b=2, c=3)
    TypeError: function takes at most 2 arguments (3 given)

ISTM it would be preferable for min() and max() to have error messages similar
to those of int():
    >>> int(0, a=1)
    TypeError: 'a' is an invalid keyword argument for int()
    >>> int(0, a=1, b=2)
    TypeError: int() takes at most 2 arguments (3 given)

we can achieve this by making a small change in Python/bltinmodule.c in
min_max (I would open a PR soon), and by resolving #31229.
History
Date User Action Args
2017-08-18 21:51:19Oren Milmansetrecipients: + Oren Milman
2017-08-18 21:51:19Oren Milmansetmessageid: <1503093079.31.0.160974520345.issue31236@psf.upfronthosting.co.za>
2017-08-18 21:51:19Oren Milmanlinkissue31236 messages
2017-08-18 21:51:19Oren Milmancreate