[Pythonmac-SIG] Re: Number format in IDE

Shelley Walsh Shelley@shells.demon.co.uk
Sun, 26 Aug 2001 21:56:27 +0100


on 26/8/01 7:09 pm, Kevin Altis at altis@semi-retired.com wrote:

> You probably want to use string formatting to control the output format.
> 
> http://www.python.org/doc/current/lib/typesseq-strings.html

Okay, I know about this, but it would be nice if there was a way of setting
the output default format, so that when you are using it as a desk
calculator it doesn't look icky, and then in another circumstance when you
don't want to be "lied to" to be able to change it back. Sure it may be
instructive for computer science students to see this sort of thing, but
math students have too many other things on their mind. Even $20 calculators
can do that with their mode buttons. I can't overwrite the repr function for
float class can I? I suppose I could create a subclass of floating point
that behaved just like normal floating point, but had a different repr, but
still that would be a bit of a pain, because you would have to write the
class name every time you used it.

-- 
Shelley Walsh
Shelley@shells.demon.co.uk
http://homepage.mac.com/shelleywalsh