[Numpy-discussion] Context manager for seterr

Julian Taylor jtaylor.debian at googlemail.com
Sun Dec 14 19:23:18 EST 2014


On 15.12.2014 01:12, Stefan van der Walt wrote:
> Hi all,
> 
> Since the topic of context managers recently came up, what do you think
> of adding a context manager for seterr?
> 
> with np.seterr(divide='ignore'):
>     frac = num / denom
> 


already exists as np.errstate:

with np.errstate(divide='ignore'):



More information about the NumPy-Discussion mailing list