[issue10621] >>> 1 + 2j --> (1 + 2j) and not (1+2j)

Boštjan Mejak report at bugs.python.org
Sat Dec 4 10:21:49 CET 2010

New submission from Boštjan Mejak <bostjan.mejak at gmail.com>:

Python interpreter should put spaces around operators in return values of complex numbers. If you give it
>>> 1 + 2j
it should return
(1 + 2j)
and not the current

My argument is that complex numbers are written like this, with spaces surrounding operators. Wikipedia has multiple instances of the complex number writren, and it's x + yi (in our world it's x + yj but you get the point and you can see that there are spaces around the operator). Please fix the tokenizer to do the right thing.

components: IO
messages: 123324
nosy: Retro
priority: normal
severity: normal
status: open
title: >>> 1 + 2j --> (1 + 2j) and not (1+2j)
versions: Python 2.7, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list