Merged revisions 55007-55179 via svnmerge from · python/cpython@805365e

GitHub

@@ -2260,7 +2260,7 @@ \section{Looping Techniques \label{loopidioms}}

22602260function.

2261226122622262\begin{verbatim}

2263->>> for i in reversed(xrange(1,10,2)):

2263+>>> for i in reversed(range(1,10,2)):

22642264... print i

22652265...

226622669

@@ -2700,12 +2700,12 @@ \section{The \function{dir()} Function \label{dir}}

27002700 'complex', 'copyright', 'credits', 'delattr', 'dict', 'dir', 'divmod',

27012701 'enumerate', 'eval', 'exec', 'execfile', 'exit', 'file', 'filter', 'float',

27022702 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex',

2703- 'id', 'int', 'isinstance', 'issubclass', 'iter',

2703+ 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter',

27042704 'len', 'license', 'list', 'locals', 'long', 'map', 'max', 'min',

27052705 'object', 'oct', 'open', 'ord', 'pow', 'property', 'quit', 'range',

27062706 'reload', 'repr', 'reversed', 'round', 'set',

27072707 'setattr', 'slice', 'sorted', 'staticmethod', 'str', 'sum', 'super',

2708- 'tuple', 'type', 'unichr', 'unicode', 'vars', 'xrange', 'zip']

2708+ 'tuple', 'type', 'unichr', 'unicode', 'vars', 'zip']

27092709\end{verbatim}

2710271027112711@@ -4762,7 +4762,7 @@ \section{Mathematics\label{mathematics}}

47624762>>> import random

47634763>>> random.choice(['apple', 'pear', 'banana'])

47644764'apple'

4765->>> random.sample(xrange(100), 10) # sampling without replacement

4765+>>> random.sample(range(100), 10) # sampling without replacement

47664766[30, 83, 16, 4, 8, 81, 41, 50, 18, 33]

47674767>>> random.random() # random float

476847680.17970987693706186