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?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Grant Edwards <grant.b.edwards@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to get a directory list sorted by date?
Date Sun, 15 May 2016 16:00:03 +0000 (UTC)
Lines 23
Message-ID <mailman.34.1463328037.2226.python-list@python.org> (permalink)
References <vmpl0d-l9n.ln1@esprimo.zbmc.eu> <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>
X-Trace news.uni-berlin.de K26RU7UqaDiMVaF3iPgSQAlQXAN3OTsbY9v3fMDtaY2Q==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:How': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'missed': 0.15; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'sequence,': 0.16; 'somewhere.': 0.16; 'sorted()': 0.16; 'wrote:': 0.16; '>>>': 0.20; '(or': 0.23; 'tim': 0.24; "i've": 0.25; 'header :User-Agent:1': 0.26; "doesn't": 0.26; 'subject:list': 0.26; 'header:X-Complaints-To:1': 0.26; 'sequence': 0.27; 'correct': 0.28; 'received:24': 0.28; 'function': 0.28; 'chase': 0.29; '15,': 0.30; 'michael': 0.33; 'received:comcast.net': 0.33; 'next': 0.35; 'item': 0.35; 'should': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'rather': 0.39; 'to:addr:python.org': 0.40; 'entire': 0.61; 'feeling': 0.72; 'subject:get': 0.81; 'sort.': 0.84; 'edwards': 0.91; 'min': 0.91; 'why?': 0.91
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host c-24-118-110-103.hsd1.mn.comcast.net
User-Agent slrn/1.0.2 (Linux)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <nha6e3$2ij$1@ger.gmane.org>
X-Mailman-Original-References <vmpl0d-l9n.ln1@esprimo.zbmc.eu> <nh9gh6$ekb$1@ger.gmane.org> <20160515061511.7c62b0e1@bigbox.christie.dr> <nha1h2$r6s$1@ger.gmane.org> <CAGgTfkPfL2e419iMLP1012q10x-6dG3vaWDvaTFyPUyMrXh3Kw@mail.gmail.com>
Xref csiph.com comp.lang.python:108641

Show key headers only | 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