[Numpy-discussion] doctest improvements patch (and possible regressions)

Paul Ivanov pivanov314@gmail....
Sun Dec 13 01:27:50 CST 2009


So far, no one has voiced objections, so should I go ahead and check
this in?

btw, thanks Mike, what about this one:

    >>> (np.char.lstrip(c, ' ') == np.char.lstrip(c, '')).all()
    ... # XXX: is this a regression? this line now returns False -pi
    ... # np.char.lstrip(c,'') does not modify c at all.
    True

best,
Paul Ivanov

Michael Droettboom, on 2009-12-09 06:04, wrote:
> Paul Ivanov wrote:
>> I marked up suspicious differences with XXX, since I don't know if
>> they're significant. In particular:
>>  - shortening a defchararray by strip does not change it's dtype to a
>> shorter one (apparently it used to?)
> Yes.  The new behavior is to return a string array with the same 
> itemsize as the input array.  That's primarily just the result of the 
> new implementation rather than a thought out change, though.
> 
> Sorry, just commenting on the parts I feel competent in :)  But I think 
> this is a great improvement.  It would be nice to start doing doctests 
> as a matter of course to keep the docs accurate.
> 
> Mike
> 



More information about the NumPy-Discussion mailing list