[Numpy-discussion] making "low" optional in numpy.randint

Robert Kern robert.kern at gmail.com
Wed Feb 17 18:55:00 EST 2016


He was talking consistently about "random integers" not
"random_integers()". :-)

On Wednesday, 17 February 2016, G Young <gfyoung17 at gmail.com> wrote:

> Your statement is a little self-contradictory, but in any case, you
> shouldn't worry about random_integers getting removed from the code-base.
> However, it has been deprecated in favor of randint.
>
> On Wed, Feb 17, 2016 at 11:48 PM, Juan Nunez-Iglesias <jni.soma at gmail.com
> <javascript:_e(%7B%7D,'cvml','jni.soma at gmail.com');>> wrote:
>
>> Also fwiw, I think the 0-based, half-open interval is one of the best
>> features of Python indexing and yes, I do use random integers to index into
>> my arrays and would not appreciate having to litter my code with "-1"
>> everywhere.
>>
>> On Thu, Feb 18, 2016 at 10:29 AM, Alan Isaac <alan.isaac at gmail.com
>> <javascript:_e(%7B%7D,'cvml','alan.isaac at gmail.com');>> wrote:
>>
>>> On 2/17/2016 3:42 PM, Robert Kern wrote:
>>>
>>>> random.randint() was the one big exception, and it was considered a
>>>> mistake for that very reason, soft-deprecated in favor of
>>>> random.randrange().
>>>>
>>>
>>>
>>> randrange also has its detractors:
>>> https://code.activestate.com/lists/python-dev/138358/
>>> and following.
>>>
>>> I think if we start citing persistant conventions, the
>>> persistent convention across *many* languages that the bounds
>>> provided for a random integer range are inclusive also counts for
>>> something, especially when the names are essentially shared.
>>>
>>> But again, I am just trying to be clear about what is at issue,
>>> not push for a change.  I think citing non-existent standards
>>> is not helpful.  I think the discrepancy between the Python
>>> standard library and numpy for a function going by a common
>>> name is harmful.  (But then, I teach.)
>>>
>>> fwiw,
>>>
>>> Alan
>>>
>>>
>>> _______________________________________________
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion at scipy.org
>>> <javascript:_e(%7B%7D,'cvml','NumPy-Discussion at scipy.org');>
>>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>>
>>
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at scipy.org
>> <javascript:_e(%7B%7D,'cvml','NumPy-Discussion at scipy.org');>
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>>
>

-- 
Robert Kern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160217/e077acd8/attachment.html>


More information about the NumPy-Discussion mailing list