Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'argument': 0.05; 'mrab': 0.05; '21,': 0.07; 'args)': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terminates': 0.09; 'python': 0.11; '>on': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sheer': 0.16; 'language': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'url:home': 0.24; 'mention': 0.26; 'skip:" 20': 0.27; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'designer': 0.30; 'url:wiki': 0.31; '+0100,': 0.31; '>>>>': 0.31; "d'aprano": 0.31; 'omitted': 0.31; 'steven': 0.31; 'terminate': 0.31; 'trivial': 0.31; 'url:wikipedia': 0.31; "we're": 0.32; 'fri,': 0.33; 'maybe': 0.34; 'could': 0.34; 'johnson': 0.35; 'himself': 0.36; 'skip:> 10': 0.36; 'charset:us- ascii': 0.36; 'url:org': 0.36; 'expected': 0.38; 'received:76': 0.38; 'somebody': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'ian': 0.60; 'worry': 0.60; 'details.': 0.61; 'skip:* 10': 0.61; "you've": 0.63; 'such': 0.63; 'different': 0.65; 'determine': 0.67; 'physical': 0.72; 'conclude': 0.84; 'hardly': 0.84; 'subject:Value': 0.84; 'universe': 0.84; 'genius': 0.91; 'rick': 0.93; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Default Value Date: Sat, 22 Jun 2013 12:49:12 -0400 Organization: IISS Elusive Unicorn References: <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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-22-77.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371919759 news.xs4all.nl 15962 [2001:888:2000:d::a6]:58679 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48934 On Fri, 21 Jun 2013 19:27:42 -0600, Ian Kelly declaimed the following: >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. Maybe in a universe with different physical constants... Otherwise I think you have encountered http://en.wikipedia.org/wiki/Halting_problem (consider: could your function conclude that it terminates when fed it's own code) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/