[issue42334] Subclassing int and complex with keyword arguments weird

Terry J. Reedy report at bugs.python.org
Sat Nov 14 03:57:55 EST 2020


Terry J. Reedy <tjreedy at udel.edu> added the comment:

When reporting a failure please copy and paste the exception and message and when non-trivial, the traceback.   In this case:  "TypeError: 'test' is an invalid keyword argument for complex()".  The difference between int and complex versus float is that the former have keyword arguments, so they check for invalid keyword arguments, whereas float take no keyword arguments, so it does not check for validity and, for subclasses, passes them on.

----------
nosy: +terry.reedy
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list