Message94868
If you think it's too long, here's a shorter version:
Sorts sequence in place with a fast stable sort, returning None. key is
a function for extracting a comparison key from each element, e.g.
key=lambda x: x['name'] or key=str.lower. reverse=True reverses the
result order.
a = [1, 3, 2]
a.sort() # a is now [1, 2, 3]
Use the "sorted()" built-in function if you need to preserve the
original list.
Is this better? You could whack the last comment about sorted and/or the
example, then it's about the same length as the other built-in
docstrings (e.g. zip, reduce, getattr). |
|
Date |
User |
Action |
Args |
2009-11-03 19:22:01 | olau | set | recipients:
+ olau, georg.brandl |
2009-11-03 19:22:00 | olau | set | messageid: <1257276120.66.0.939983786588.issue7257@psf.upfronthosting.co.za> |
2009-11-03 19:21:59 | olau | link | issue7257 messages |
2009-11-03 19:21:59 | olau | create | |
|