Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85951
| References | (1 earlier) <CANy1k1gMgGnqNcgTwjcqfYH-QctZthv89uXcU8SV9Uk6Wji=4A@mail.gmail.com> <CAPTjJmpeYwsQ=XLu5WicVEnqMZpvKJueZRrM9WGafcEm1BFatg@mail.gmail.com> <CANy1k1j8ni7TtZPq_a2r8TUvY13rh0oY8xt-t6+9KPxwfAYEyw@mail.gmail.com> <CAPTjJmpq3t4qb+VD+uL6w+=_wf5v0BFThYFM+a8JAe2RDXpTYg@mail.gmail.com> <CANy1k1j+_boVW4EP=fijUKFVRctzD8EETm3kZ==eoezA=S=a6Q@mail.gmail.com> |
|---|---|
| Date | 2015-02-20 16:57 +1100 |
| Subject | Re: What behavior would you expect? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18913.1424411875.18130.python-list@python.org> (permalink) |
On Fri, Feb 20, 2015 at 4:51 PM, Jason Friedman <jsf80238@gmail.com> wrote: >> I'd still advise using my_list.sort() rather than sorted(), as you >> don't need to retain the original. >> > > Hmm. > > Trying to figure out what that looks like. > If I understand correctly, list.sort() returns None. > What would I return to the caller? Check its docs: it sorts the list in place. So you return the list, after you sort it. It's like appending to a list: None is returned and the list itself is changed. ChrisA
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: What behavior would you expect? Chris Angelico <rosuav@gmail.com> - 2015-02-20 16:57 +1100
csiph-web