Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.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.075 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'argument': 0.05; 'mrab': 0.05; '21,': 0.07; '22,': 0.09; 'args)': 0.09; 'python': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sheer': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'mention': 0.26; 'skip:" 20': 0.27; 'header:In-Reply- To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'function': 0.29; 'am,': 0.29; 'designer': 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; '+0100,': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'omitted': 0.31; 'steven': 0.31; 'terminate': 0.31; 'trivial': 0.31; "we're": 0.32; 'fri,': 0.33; 'could': 0.34; 'johnson': 0.35; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'himself': 0.36; 'view,': 0.36; 'expected': 0.38; 'somebody': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'ian': 0.60; 'worry': 0.60; 'most': 0.60; 'details.': 0.61; 'skip:* 10': 0.61; "you've": 0.63; 'such': 0.63; 'determine': 0.67; 'theoretical': 0.74; 'beats': 0.84; 'hardly': 0.84; 'subject:Value': 0.84; 'for).': 0.91; 'genius': 0.91; 'rick': 0.93; '2013': 0.98 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:to :content-type; bh=eassmhTYGI+/0YaLmjVcabbfFJxcAD+6GR3bzKAgHVc=; b=I+RFmg81bJ0xCyMQQFtMyUT3KsOSdRRQLoHJe3TvBdAD3sXGKlv5k47OFhnMLnXMmq a2+gO+Jnce45WEmt+rueTA2jCaPyTrCmjGXIKFwoKrhrDnM/PdyTVDX9/2e+cM0DbtyF mC3tDbADu44fC9p5bEekgyFarrwdGm82DJ+vD/7EwFJe7yWU3jtNJFq6XIlUWYQKUUux Tb4y5ta6MLrpUoDhnNzt048XIFhQMAAlRLWko0h/wpeAi7wg0LI4qdO4JcaBsPum04de 5ytoA9od5KtngBPjJnc+I84Ub/Cz/ocCDzCWqgrutMbiHGROkhncAaeKceeZ9BuPxMfY vGjQ== MIME-Version: 1.0 X-Received: by 10.220.202.197 with SMTP id ff5mr6727697vcb.3.1371865306404; Fri, 21 Jun 2013 18:41:46 -0700 (PDT) In-Reply-To: References: <7e6361d5-6619-4aaa-adda-8b5f01bde57f@googlegroups.com> <447dd1c6-1bb2-4276-a109-78d7a067b442@d8g2000pbe.googlegroups.com> <2e92b4c7-31be-40d2-a906-ab19f3630dfa@googlegroups.com> <51c477dd$0$29999$c3e8da3$5496439d@news.astraweb.com> <565a1c8f-6fd9-4bab-9834-076eaea527f8@googlegroups.com> <7e1ed740-df18-4978-b11d-8ca9c4b5bd04@googlegroups.com> <03e9544e-9d6d-4155-a793-56f0c22c7f7a@googlegroups.com> <51c4fab1$0$29999$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 22 Jun 2013 11:41:46 +1000 Subject: Re: Default Value From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371865314 news.xs4all.nl 15870 [2001:888:2000:d::a6]:45558 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48899 On Sat, Jun 22, 2013 at 11:27 AM, Ian Kelly wrote: > On Fri, Jun 21, 2013 at 7:15 PM, Steven D'Aprano > wrote: >> On Fri, 21 Jun 2013 23:49:51 +0100, MRAB wrote: >> >>> On 21/06/2013 21:44, Rick Johnson wrote: >> [...] >>>> Which in Python would be the "MutableArgumentWarning". >>>> >>>> *school-bell* >>>> >>> I notice that you've omitted any mention of how you'd know that the >>> argument was mutable. >> >> That's easy. Just call ismutable(arg). The implementation of ismutable is >> just an implementation detail, somebody else can work that out. A >> language designer of the sheer genius of Rick can hardly be expected to >> worry himself about such trivial details. > > While we're at it, I would like to petition for a function > terminates(f, args) that I can use to determine whether a function > will terminate before I actually call it. Nice idea from a theoretical point of view, but practicality beats purity, and most people know their functions will terminate (that's what Ctrl-C is for). No, I want a function isbuggy(f) to find out whether a function is, well, buggy. We could abolish all unit-testing if we had that. ChrisA