Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!bcyclone04.am1.xlned.com!bcyclone04.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'modify': 0.07; "(i'd": 0.09; 'promising': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.12; 'wrote': 0.14; 'flow,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'thereby': 0.16; 'appropriate': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'tend': 0.24; 'define': 0.26; 'header:X-Complaints-To:1': 0.27; 'am,': 0.29; 'but': 0.35; 'subject:?': 0.36; 'list': 0.37; 'list.': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; "you're": 0.61; 'decided': 0.64; 'frank': 0.68; 'nobody': 0.68; 'default': 0.69; 'subject:this': 0.83; 'acceptable)': 0.84; 'trick,': 0.84; 'trick.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: "Frank Millman" Subject: Re: Is this unpythonic? Date: Fri, 8 May 2015 15:12:11 +0200 References: <554c8b0a$0$12992$c3e8da3$5496439d@news.astraweb.com> <554CA652.1000607@davea.name> X-Gmane-NNTP-Posting-Host: 197.86.223.132 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.4657 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4913 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431090908 news.xs4all.nl 2889 [2001:888:2000:d::a6]:44313 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3201 X-Received-Body-CRC: 1796395431 Xref: csiph.com comp.lang.python:90168 "Dave Angel" wrote in message news:554CA652.1000607@davea.name... > On 05/08/2015 06:53 AM, Frank Millman wrote: >> > > It might be appropriate to define the list at top-level, as > > EMPTY_LIST=[] > > and in your default argument as > def x(y, z=EMPTY_LIST): > > and with the all-caps, you're thereby promising that nobody will modify > that list. > > (I'd tend to do the None trick, but I think this alternative would be > acceptable) > Thanks, Dave, I like that idea. However, as you can see from my other replies, I have decided to go with the flow, and use the None trick. Frank