[Numpy-discussion] A context manager for print options

Nathaniel Smith njs at pobox.com
Sun Oct 27 06:48:35 EDT 2013


On 27 Oct 2013 09:02, "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.

I think the only reason is that no one's written up a patch and submitted a
PR. Maybe you'll be the one? ;-)

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131027/93b8f480/attachment.html>


More information about the NumPy-Discussion mailing list