Message 86719 - Python tracker (original) (raw)

Two things that haven't come up so far:

(1) What about parentheses? The current complex repr and str have parentheses in them, for reasons that I still don't really understand.

I'd suggest leaving them out altogether; except that I have the impression (perhaps wrongly) that an empty type code is supposed to correspond to str. And given that I don't understand why the parens were in there in the first place, I'm probably not a good person to judge whether they should stay in a formatted complex number.

(2) What about zeros? The current repr and str leave out the real part (and the enclosing parens) if it's equal to zero. Should format do the same? I'd say not, except possibly again in the case where there's no type code.