This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hwundram
Recipients
Date 2006-05-19.21:27:31
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
As per request on c.l.p:

http://groups.google.de/group/comp.lang.python/browse_thread/thread/26c93fefefd3a100/bf1924ce28fac1ac?hl=de#bf1924ce28fac1ac

I've implemented a small patch to change the output of
repr(x) for complex variables, so that complex(repr(x))
works for any complex x. This changes the output of
repr(x) to

'<r>+<i>j'

without brackets, but leaves the string output
untouched. This change of behaviour would be in line
with int(repr(x)) and float(repr(x)) being defined for
any int or float x, repectively.

I don't know whether this patch is sensible, and
whether it breaks any current code, because (for example)

eval("5*%r" % (1+2j,))

won't work properly anymore, or whether it'd be more
sensible to change the complex constructor to also
accept a bracketed expression. I'll attach a patch to
do the latter later.
History
Date User Action Args
2007-08-23 15:48:58adminlinkissue1491866 messages
2007-08-23 15:48:58admincreate