[PYTHON MATRIX-SIG] printing arrays
Paul. Dubois
dubois1@llnl.gov
Wed, 07 Feb 1996 14:40:23 -0800
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."
--
Paul F. Dubois, L-472 (510)-422-5426
Lawrence Livermore National Laboratory FAX (510)-423-9969
Livermore, CA 94550 dubois1@llnl.gov
Consulting: PaulDubois@aol.com
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================