Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b606b3d0
Commit
b606b3d0
authored
Dec 17, 2003
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
parent
e708fbd2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Doc/lib/liboperator.tex
Doc/lib/liboperator.tex
+2
-2
No files found.
Doc/lib/liboperator.tex
View file @
b606b3d0
...
...
@@ -302,7 +302,7 @@ Example: Build a dictionary that maps the ordinals from \code{0} to
The
\module
{
operator
}
module also defines tools for generalized attribute
and item lookups. These are useful for making fast field extractors
as arguments for
\function
{
map()
}
,
\
method
{
list.sort
()
}
,
as arguments for
\function
{
map()
}
,
\
function
{
sorted
()
}
,
\method
{
itertools.groupby()
}
, or other functions that expect a
function argument.
...
...
@@ -328,7 +328,7 @@ Examples:
>>> getcount = itemgetter(1)
>>> map(getcount, inventory)
[3, 2, 5, 1]
>>>
list.
sorted(inventory, key=getcount)
>>> sorted(inventory, key=getcount)
[('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
\end{verbatim}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment