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


Groups > comp.lang.python > #108641

Re: How to get a directory list sorted by date?

From Grant Edwards <grant.b.edwards@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to get a directory list sorted by date?
Date 2016-05-15 16:00 +0000
Message-ID <mailman.34.1463328037.2226.python-list@python.org> (permalink)
References (1 earlier) <nh9gh6$ekb$1@ger.gmane.org> <20160515061511.7c62b0e1@bigbox.christie.dr> <nha1h2$r6s$1@ger.gmane.org> <CAGgTfkPfL2e419iMLP1012q10x-6dG3vaWDvaTFyPUyMrXh3Kw@mail.gmail.com> <nha6e3$2ij$1@ger.gmane.org>

Show all headers | View raw


On 2016-05-15, Michael Selik <michael.selik@gmail.com> wrote:
> On Sun, May 15, 2016, 10:37 AM Grant Edwards <grant.b.edwards@gmail.com> wrote:
>> On 2016-05-15, Tim Chase <python.list@tim.thechases.com> wrote:
>>>
>>> unless sorted() returns a lazy sorter,
>>
>> What's a lazy sorter?
>
> One that doesn't calculate the next item in the sequence until you
> ask for it. It's impossible

Why?  As long as the function has access to the entire sequence, it
should be trivial.  Just find the min (or max) item in the sequence,
remove it, then return it.  It's horribly inefficient, but...

> unless you don't mind an approximation rather than correct sort.

I have a feeling that I've missed the joke somewhere.

-- 
Grant

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get a directory list sorted by date? cl@isbd.net - 2016-05-15 09:47 +0100
  Re: How to get a directory list sorted by date? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-05-15 20:48 +1000
  Re: How to get a directory list sorted by date? Michael Selik <michael.selik@gmail.com> - 2016-05-15 15:50 +0000
  Re: How to get a directory list sorted by date? Grant Edwards <grant.b.edwards@gmail.com> - 2016-05-15 16:00 +0000
  Re: How to get a directory list sorted by date? Tim Chase <python.list@tim.thechases.com> - 2016-05-15 13:12 -0500
    Re: How to get a directory list sorted by date? cl@isbd.net - 2016-05-15 21:23 +0100
  Re: How to get a directory list sorted by date? Chris Angelico <rosuav@gmail.com> - 2016-05-16 07:52 +1000
  Re: How to get a directory list sorted by date? Random832 <random832@fastmail.com> - 2016-05-16 12:40 -0400

csiph-web