[PYTHON MATRIX-SIG] printing arrays

Jim Fulton jfulton@usgs.gov
Wed, 7 Feb 1996 17:52:47 -0500


On Feb 7,  2:40pm, Paul. Dubois wrote:
> Subject: [PYTHON MATRIX-SIG] printing arrays
> Here is my take on this:
>
> >From a purely object-oriented point of view, the width/precision are
> attributes of the *array formatter*, ie an object that knows how to
> print arrays. At the moment, this gets confounded with the array itself.
> The default formatter object could be a class variable (i.e., when an
> array is created, it has as its default formatter a single shared
> formatter). This means that changing the precision in the shared
> formatter would change it across the board.
>
> The discussion has really arisen because array isn't really a class and
> the "object" that does the printing in it is a function that doesn't
> have any state, so we've started to talk about where to put that state.
>
> In general, while I appreciate Jim Fulton's concern about
> compartmentalizing things, I think in practice the idea of a
> user-changeable default printing precision is well established in
> similar products. "How do I increase the number of decimals" is
> certainly a FAQ for Basis users. They don't ask, "How do I increase the
> number of decimals for printing THIS array only."

OK, I have no problem with a user settable default precision.  Why not have a
default set in Numeric and let arrays also have attributes that are initialized
with the default, and can be set by the user?

Actually, my main gripe at this point is that I don't like diddling sys for.  I
can live with having global variables set in some array-specific module.

Jim

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================