[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Christopher Smith
Christopher Smith added the comment: On Sun, Oct 6, 2013 at 12:14 AM, Raymond Hettinger wrote: > > Raymond Hettinger added the comment: > > Christopher, this tracker item needs to die. It is wasting everyone's > time (and churning code) over nothing. > > but it's not quite dead yet... > FYI, I

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Christopher, this tracker item needs to die. It is wasting everyone's time (and churning code) over nothing. FYI, I moved the _int=int for shuffle inside the function because the assignment was outside of the inner loop, so we weren't getting any real ben

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 50ea4dccb03e by Raymond Hettinger in branch '3.3': Issue 14927: Remove a docstring line that is no longer applicable. http://hg.python.org/cpython/rev/50ea4dccb03e -- ___ Python tracker

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Christopher Smith
Christopher Smith added the comment: In 3.3 and 3.4 I would just change the shuffle arg from `int=int` to `_int=int` and delete the comment in docstring regarding not supplying the value. (In both you *removed* the argument and internally added `_int=int`.) Note that (as far as I can see) in 3.3

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Py3.3: http://hg.python.org/cpython/rev/0899960835f5 Py3.4: http://hg.python.org/cpython/rev/8494d2c8ef54 -- ___ Python tracker ___ _

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset b1e94e332ec8 by Raymond Hettinger in branch '2.7': Issue 14927: Minor clean-up of function parameters in random(). http://hg.python.org/cpython/rev/b1e94e332ec8 -- ___ Python tracker

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Christopher Smith
Christopher Smith added the comment: I probably wouldn't have noticed it except I was working more intensely with the different random methods and saw that randrange had the note about not supplying the 'int' argument and shuffle (though it had the same sort of argument) did *not* have the commen

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Tim Peters
Tim Peters added the comment: I'm old, but I liked the docs better when they didn't mention "the int argument" at all. The "int=int" - or "_int=int" - argument is a CPython implementation detail. It has nothing to do with the API. And _of course_ users shouldn't mess with implementation det

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: I don't think there is an actual problem here to be solved. -- ___ Python tracker ___ ___ Python-

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Senthil Kumaran
Senthil Kumaran added the comment: Hi Raymond, Ezio provided some comments on improvements to the patch. Do you mind if Ezio or I take over task of improvement. Not cause problems != no need to improve. TIA. -- ___ Python tracker

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think the "Do not supply the 'int' argument" covers it well enough. This code has been around for a very long time and isn't causing any problems. -- status: open -> closed ___ Python tracker

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-10-05 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti versions: +Python 3.4 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thanks for catching the mistake at _randbelow. Updated patch to fix that and removed the explanation in the docstring. Not sure if _randbelow should changed (fully) or not at all. Leaving the change only with _int. Will wait for Raymond's review. -- A

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Georg Brandl
Georg Brandl added the comment: I wouldn't add info about the optimization in the docstring. In _randbelow() I think you missed a call to int(). For _randbelow(), all arguments after "int" are non-public ones. (_randbelow as a private function wouldn't necessarily need the change, but it's good

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: Attaching a patch after changing int=int to _int = int and improving the docstring. Please review the changes to the docstring and see if it will be helpful. -- status: closed -> pending Added file: http://bugs.python.org/file31788/14927.diff ___

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: Tim Peters added the comment: > ..., _fast=slow, ... > > in an argument list means we endure the slow lookup (of `slow`) only > once, when the function is first defined. When the function is > _called_, that binding is available via the local (much faster

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Tim Peters
Tim Peters added the comment: [Senthil Kumaran] > I am unaware of the optimization technique you refer to as > well, it will helpful if you could point to any resource. It's an old trick since the very first Pythons: global lookups are much slower than local lookups (the difference between the

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: > Georg Brandl added the comment: > > I would propose a leading underscore for these methods; they should make it > clear to the user that the parameter is meant to be "private". +1 to this proposal. This style is present with randrange, randbelow and shuffle.

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-15 Thread Georg Brandl
Georg Brandl added the comment: I would propose a leading underscore for these methods; they should make it clear to the user that the parameter is meant to be "private". With this line in the docstring, I would wonder "Why is the argument there in the first place?!" (because most people don't

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-11 Thread Senthil Kumaran
Senthil Kumaran added the comment: This is fixed in all versions. Thank you! -- nosy: +orsenthil resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed type: -> behavior ___ Python tracker

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2013-09-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 82bdd5fc7a71 by Senthil Kumaran in branch '2.7': Improve the docstring of random.shuffle. Inform users not to provide int arg. http://hg.python.org/cpython/rev/82bdd5fc7a71 New changeset 4782faf29480 by Senthil Kumaran in branch '3.3': Improve the d

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2012-06-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2012-06-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2012-06-11 Thread Christopher Smith
Christopher Smith added the comment: On Tue, Jun 12, 2012 at 1:34 AM, Michael Driscoll wrote: > > Michael Driscoll added the comment: > > I added the extra information to the docstring for the shuffle method and > attached a patch. Thanks Michael (and Python team)! Chris -- __

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2012-06-11 Thread Michael Driscoll
Michael Driscoll added the comment: I added the extra information to the docstring for the shuffle method and attached a patch. -- keywords: +patch nosy: +michael.driscoll Added file: http://bugs.python.org/file25938/shuffle.patch ___ Python tracker

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2012-06-09 Thread Éric Araujo
Changes by Éric Araujo : -- keywords: +easy nosy: +sandro.tosi stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mail

[issue14927] add "Do not supply 'int' argument" to random.shuffle docstring

2012-06-01 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo title: add "Do not supply int argument" to random.shuffle docstring -> add "Do not supply 'int' argument" to random.shuffle docstring ___ Python tracker _

[issue14927] add "Do not supply int argument" to random.shuffle docstring

2012-05-28 Thread Christopher Smith
Christopher Smith added the comment: > nosy: +rhettinger > title: add not about int to shuffle -> add "Do not supply int argument" to > random.shuffle docstring > versions: +Python 2.7, Python 3.3 > Thanks. I couldn't even figure out what my own subject meant! (I see that the "e" was miss

[issue14927] add "Do not supply int argument" to random.shuffle docstring

2012-05-27 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +rhettinger title: add not about int to shuffle -> add "Do not supply int argument" to random.shuffle docstring versions: +Python 2.7, Python 3.3 ___ Python tracker ___