Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Fri, 20 Nov 2015 09:29:41 -0700 Lines: 12 Message-ID: References: <564dbe6b$0$1610$c3e8da3$5496439d@news.astraweb.com> <564df258$0$1604$c3e8da3$5496439d@news.astraweb.com> <564e71f6$0$1619$c3e8da3$5496439d@news.astraweb.com> <877flcrh26.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de qgCRcUj93A+dk+aQ8qQb8wXv7V2PzeZxIJIw8VdHKERw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.080 X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'def': 0.13; 'argument': 0.15; 'overloaded': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'try:': 0.18; '2015': 0.20; 'am,': 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'usually': 0.33; 'except': 0.34; 'received:google.com': 0.35; 'ones': 0.35; 'c++': 0.35; 'nov': 0.35; 'should': 0.36; 'received:209.85': 0.36; 'cases': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'version': 0.38; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'where': 0.40; 'default': 0.61; 'more': 0.63; 'different': 0.63; '20,': 0.66; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=HMu65KHC91nvTDvqfKa0Hg7zHrIfGdB/k3OQoPwWAss=; b=F5Tzg24wdwaX/PbJIBwvmY9f5IDtnbVvKFRdErOVF7/xmJB5fcHQf62QI4l6ZxNNyX Rs9sIOInHh9Ic0zDTFOCXKyHlcvbZgK26Rq4u3UWXTDPakgntHRLi7qy3qM3GymaUNVa Qt9160OWde9F98BWJgLamoKSjHXjBVSIsSxWXIYyHvF86xZGMWxe2H5ZHwm41mlETdL1 +eCxDsvaWmTpJKMto/E7W++Hs6QdiPLdUC2UpaO+53hlB0/aI7dkPP1dkIjjBbi4tFUg h6vpmCXbE4lU5KL7bX6H8p4HvVSasq2IRl2Da271i+Ms6EZ6ML4dtncfam82CP7CnASG 4m+g== X-Received: by 10.50.78.231 with SMTP id e7mr777657igx.93.1448037021025; Fri, 20 Nov 2015 08:30:21 -0800 (PST) In-Reply-To: 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: , Xref: csiph.com comp.lang.python:99164 On Fri, Nov 20, 2015 at 9:24 AM, Chris Angelico wrote: > The cases where that's not true are usually ones that are more like > C++ overloaded functions: > > def next(iter): > return iter.__next__() > def next(iter, default): > try: return iter.__next__() > except StopIteration: return default IMO the version with the default argument should have a different name, as it is conceptually a different function.