Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b606b3d

Browse files
committed
Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
1 parent e708fbd commit b606b3d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/lib/liboperator.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ \section{\module{operator} ---
302302

303303
The \module{operator} module also defines tools for generalized attribute
304304
and item lookups. These are useful for making fast field extractors
305-
as arguments for \function{map()}, \method{list.sort()},
305+
as arguments for \function{map()}, \function{sorted()},
306306
\method{itertools.groupby()}, or other functions that expect a
307307
function argument.
308308

@@ -328,7 +328,7 @@ \section{\module{operator} ---
328328
>>> getcount = itemgetter(1)
329329
>>> map(getcount, inventory)
330330
[3, 2, 5, 1]
331-
>>> list.sorted(inventory, key=getcount)
331+
>>> sorted(inventory, key=getcount)
332332
[('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
333333
\end{verbatim}
334334

0 commit comments

Comments
 (0)