[PYTHON MATRIX-SIG] New pretty printer
James Hugunin
jjh@Goldilocks.LCS.MIT.EDU
Tue, 6 Feb 96 09:21:02 EST
From: hinsenk@ere.umontreal.ca (Konrad HINSEN)
I didn't look yet at how you did it but perhaps a user-settable
precision could be managed. I have done that in both Basis and
Just implemented :-) The problem with both this and the line width is
that there is no convenient way to set them when simply printing
arrays. Right now, you have to call the function arrayToString()
explicitly with additional parameters. I could of course define global
variables in module Numeric to handle this, but I am not sure whether
that is a good idea. Maybe a good compromise is optional parameters
that are set from global variables if undefined. Comments?
The compromise approach sounds perfect. I think that this is one of
those rare cases where there is no potential for problems to be caused
by global variables because you are not going to be altering the
results of any computation, only the way those results are displayed.
Without global variables there is just no reasonable way to alter the
default behavior for "print a".
-Jim
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================