[Numpy-discussion] A context manager for print options

Matthew Brett matthew.brett at gmail.com
Sun Oct 27 15:17:10 EDT 2013


Hi,

On Sun, Oct 27, 2013 at 2:01 AM, Neil Girdhar <mistersheik at gmail.com> wrote:
> Why not replace get_printoptions/set_printoptions with a context manager
> accessed using numpy.printoptions in the same way that numpy.errstate
> exposes a context manager to seterr/geterr?  This would make the set method
> redundant.
>
> Also, the context manager returned by numpy.errstate, numpy.printoptions,
> etc. could expose the dictionary directly.  This would make the get methods
> redundant.

Great idea ...

Matthew



More information about the NumPy-Discussion mailing list