Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone02.am1.xlned.com!bcyclone02.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.069 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'none,': 0.07; 'subject:would': 0.07; 'string': 0.09; 'cc:addr:python-list': 0.11; '"to': 0.16; 'filename.': 0.16; 'non-string': 0.16; 'pattern."': 0.16; 'exception': 0.16; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'matching': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'agreed.': 0.31; 'file': 0.32; "i'd": 0.34; 'could': 0.34; 'problem': 0.35; 'agree': 0.35; 'received:google.com': 0.35; 'returning': 0.36; 'subject:?': 0.36; 'too': 0.37; 'list.': 0.37; 'easily': 0.37; 'files': 0.38; 'little': 0.38; 'recent': 0.39; 'bad': 0.39; 'most': 0.60; 'name': 0.63; 'story': 0.63; 'saw': 0.77; 'late,': 0.84; 'mistaken': 0.84; 'subject:you': 0.87; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=94NujpYAQKBFs2MGdR5zYYfWfwEcLtxvXjcjt9d9b7g=; b=Ch5QQn81KR5ttg1wSPe0zh6ByAJjWxhVs8bBdq3ZwdMw2cPraj7SQo/WecaXVgzpFj d5Kk9hXjd21iBHGAmTABJgaMF8CLOyqg5SOGtFSPdNZjptwckDY5Yl+mjSlZNczjYpfb IwE3JKkuju565JKTGNpEWgw1nmRqZ6yhipmRtLuWaAeoDEJFKJO2D3re7ssL2tIGKzJC AEp5tYxLFRQ+MOo7gGhpB0j96u174pMyVz/F1QWpbO4PbvWa3wxaVcyoywugGz6rpYPi mBd70qqb0aV10LXKvK7WVS77IdOB5gn+9cDMsK94AAVvE1lQ5xqCsiyikPiJXam2W+mO 1v3g== MIME-Version: 1.0 X-Received: by 10.180.78.4 with SMTP id x4mr21454678wiw.86.1424411354852; Thu, 19 Feb 2015 21:49:14 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Feb 2015 22:49:14 -0700 Subject: Re: What behavior would you expect? From: Jason Friedman Cc: python-list Content-Type: multipart/alternative; boundary=f46d043bdf5ed1f1a0050f7e9c25 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424411363 news.xs4all.nl 2976 [2001:888:2000:d::a6]:53046 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 4922 X-Received-Body-CRC: 3539032326 Xref: csiph.com comp.lang.python:85949 --f46d043bdf5ed1f1a0050f7e9c25 Content-Type: text/plain; charset=UTF-8 I think I came in a little late, and saw "2. no files match the given > pattern," in which case I'm sticking to my story and returning an empty > list. > > The original problem was "to search a directory and return the name of > the most recent file matching a given pattern." I'd still prefer an > exception to None, and we agree on that an empty string is bad because > it's not a non-string and it could be too easily mistaken for a > filename. > > Agreed. --f46d043bdf5ed1f1a0050f7e9c25 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



I think I came in a little late, and saw "2. no files match the= given
pattern," in which case I'm sticking to my story and returning an = empty
list.

The original problem was "to search a directory and return the name of=
the most recent file matching a given pattern."=C2=A0 I'd still pr= efer an
exception to None, and we agree on that an empty string is bad because
it's not a non-string and it could be too easily mistaken for a
filename.


Agreed.
--f46d043bdf5ed1f1a0050f7e9c25--