Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #85950 > unrolled thread

Re: What behavior would you expect?

Started byJason Friedman <jsf80238@gmail.com>
First post2015-02-19 22:51 -0700
Last post2015-02-20 05:58 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: What behavior would you expect? Jason Friedman <jsf80238@gmail.com> - 2015-02-19 22:51 -0700
    Re: What behavior would you expect? Dan Sommers <dan@tombstonezero.net> - 2015-02-20 05:58 +0000

#85950 — Re: What behavior would you expect?

FromJason Friedman <jsf80238@gmail.com>
Date2015-02-19 22:51 -0700
SubjectRe: What behavior would you expect?
Message-ID<mailman.18912.1424411525.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

>
> 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?


> If you're going to call listdir, you probably want to use fnmatch directly.
>
>
Got it.

[toc] | [next] | [standalone]


#85952

FromDan Sommers <dan@tombstonezero.net>
Date2015-02-20 05:58 +0000
Message-ID<mc6idh$j1q$3@dont-email.me>
In reply to#85950
On Thu, 19 Feb 2015 22:51:57 -0700, Jason Friedman 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?

my_list.  In the end, it'll look something like this:

def f():
    my_list = some_other_function_that_returns_an_unsorted_list()
    my_list.sort()
    return my_list

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web