New submission from Manish Goregaokar: When the second argument of complex() is not a number/string, the type error reports the error but prints the type of the first argument:
> complex({1:2},1j) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: complex() argument must be a string or a number, not 'dict' >complex(1j,{1:2}) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: complex() argument must be a string or a number, not 'complex' >>> complex(1, {1:2}) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: complex() argument must be a string or a number, not 'int' ---------- components: Library (Lib) messages: 276952 nosy: Manish Goregaokar priority: normal severity: normal status: open title: complex() gives wrong error when the second argument has an invalid type type: enhancement versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28203> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com