[PYTHON MATRIX-SIG] New pretty printer
Jim Fulton
jfulton@usgs.gov
Wed, 7 Feb 1996 16:55:36 -0500
On Feb 7, 4:46pm, Konrad HINSEN wrote:
> Subject: Re: [PYTHON MATRIX-SIG] New pretty printer
>
> > OK. Then it makes sense to add another parameter for printing
> > precision and use it also for scalars.
>
> I'd rather see precision handled as an array attribute.
>
> But it isn't. If precision were an attribute of an object, you would
> expect arithmetic etc. to respect it. But what we are discussing is
> just a matter of output formatting. To be consistent, you would
> also have to require that the radix for integer output be a
> property of an object, creating separate types for decimal and
> hex numbers.
>
> If precision were an attribute, we would also have to decide what the
> precision of the result of an array operation is. This just doesn't
> make sense.
Perhaps precision is a poor term. "output precision" is fine with me.
My opinion is based on two ideas:
- The output precision is needed specifically for printing arrays, mainly
because you have lots of data to output.
- Global variables are bad. A correlary is that changes to core things like
sys is bad. I don't mind output width beig added to sys, because it
clearly is not array specific. (Well, maybe I do. :)
Jim
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================