summaryrefslogtreecommitdiff
path: root/numpy/array_api/_array_object.py
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2020-02-27 16:30:54 -0800
committerRoss Barnowski <rossbar@berkeley.edu>2020-05-07 10:26:32 -0700
commit9c83b13ce1b08aed8181d284566d002086393a89 (patch)
treee0d8e8316290306ab381e6997399630f0ff1ef01 /numpy/array_api/_array_object.py
parent965b41d418e6100c1afae0b6f818a7ef152bc25d (diff)
downloadnumpy-9c83b13ce1b08aed8181d284566d002086393a89.tar.gz
ENH: Improved __str__, __format__ for polynomials
Changes the printing style of instances of the convenience classes in the polynomial package to a more "human-readable" format. __str__ has been modified and __format__ added to ABCPolyBase, modifying the string representation of polynomial instances, e.g. when printed. __repr__ and the _repr_latex method (which is used in the Jupyter environment are unchanged. Two print formats have been added: 'unicode' and 'ascii'. 'unicode' is the default mode on *nix systems, and uses unicode values for numeric subscripts and superscripts in the polynomial expression. The 'ascii' format is the default on Windows (due to font considerations) and uses Python-style syntax to represent powers, e.g. x**2. The default printing style can be controlled at the package-level with the set_default_printstyle function. The ABCPolyBase.__str__ has also been made to respect the linewidth printoption. Other parameters from the printoptions dictionary are not used. Co-Authored-By: Warren Weckesser <warren.weckesser@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Diffstat (limited to 'numpy/array_api/_array_object.py')
0 files changed, 0 insertions, 0 deletions