[Mark Dickinson <dicki...@gmail.com>] > .... > There's definitely potential benefit in some of this - e.g., It Would Be Nice > If > `-1 * complex(inf, 0.0)` gave `complex(-inf, -0.0)` instead of the current > result of > `complex(-inf, nan)`.
Except replacing -1 with "-1.0" or "complex(-1)" would presumably _still_ return complex(-inf, nan), despite that >>> -1 == -1.0 == complex(-1) True That would be mondo surprising too. If that's wanted, better for complex.__mul__ to detect on its own whether component parts are 0, and use a simpler multiplication implementation if so. For example, this similar surprise has nothing to do with type promotion: >>> 1j * complex(math.inf, -0.0) (nan+infj) > But the price in added complexity - both conceptual complexity and > implementation complexity - seems too high. That, plus I'm\ still\ waiting for a plausible use case ;-) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/CJUPX2FQAMAISHYWTOI4SW4A3YVFVQA5/ Code of Conduct: http://python.org/psf/codeofconduct/