'complex' function with string argument.

Skip Montanaro skip at pobox.com
Mon Mar 17 19:59:44 EDT 2014


On Mon, Mar 17, 2014 at 5:06 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> Mathematicians genearally write both without spaces.

Mathematicians also have a tendency to use single letter variables and
often escape into non-ASCII character sets as well. <wink>

Perhaps it's worth pointing out that pylint complains about most/many
infix operations if you don't surround the operator with white space.
And, complex expressions work just fine with white space around the
operator:

>>> 1 + 2j
(1+2j)

Personally, I'm agnostic to the proposed change. I don't use complex
numbers in my work, and I suspect that creating complex numbers from
strings is an extremely small corner case.

Skip



More information about the Python-list mailing list