Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) Date: Wed, 25 Nov 2015 20:01:43 -0700 Lines: 29 Message-ID: References: <87d1v5emhl.fsf@elektro.pacujo.net> <564e6a62$0$1620$c3e8da3$5496439d@news.astraweb.com> <56556DF8.1080407@rece.vub.ac.be> <878u5mns8z.fsf@elektro.pacujo.net> <858u5lc0r7.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de vo6gCkFzMrD6rC6lPY+jlgqMvgn7/dp53S6Ibo1VmA0w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'important,': 0.07; 'immutable': 0.09; 'mutable': 0.09; 'tuple': 0.09; 'python': 0.10; 'wed,': 0.15; 'subject: \n ': 0.15; '(2,': 0.16; '(3,': 0.16; '[2,': 0.16; 'describing': 0.16; 'distinction': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'tuple;': 0.16; 'wrote:': 0.16; '2015': 0.20; 'not,': 0.22; 'trying': 0.22; '(or': 0.23; 'header:In-Reply-To:1': 0.24; 'not.': 0.27; 'right.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'sequence': 0.27; 'e.g.': 0.30; 'ordered': 0.33; 'lists': 0.34; 'list': 0.34; 'gives': 0.35; 'received:google.com': 0.35; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; 'received:209.85': 0.36; '(i.e.': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'really': 0.37; 'list.': 0.37; 'difference': 0.38; 'received:209': 0.38; 'mean': 0.38; 'means': 0.39; 'does': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'collection': 0.60; 'course': 0.62; 'different': 0.63; 'between': 0.65; '8bit%:21': 0.70; 'skip:\xe2 10': 0.70; 'to:name:python': 0.84; 'contents,': 0.91 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:content-transfer-encoding; bh=VSNhvclc9cJxlJG5F7+dpFX3CgLEKzg5GlVavugm6Rk=; b=bNYprbVwGoRRrOwVxv/Nd2he6PY/jTectU1LHqwGa60nSaNktJgAklksAokj7NniIw s7OLlq8OIts28aUwUGCvx/Snyq+8bwgLHVEGByZX0hPFPedegmy4sTCOOCJBjmiU2I5Y SBrTc+AXly0ZGdETjWRf0RsfxpX1fR/FJ1nJ5HyVZ9L+uUcBWAlLuziMuSCSl+IVkc58 eEufb3LnjyEK67eJmOzFuStx8uTVk0Yr7nis7eiPagkLD6seapttOYBN7bK+tKrs4sqd 1hSkZsvRFKIIjRrW6qpA5nMNuTpXinVFEMgIPw8F5DkV4Rk4pPQodJXOgJUkPLm1b85J 6gHw== X-Received: by 10.107.137.226 with SMTP id t95mr37785477ioi.188.1448506943590; Wed, 25 Nov 2015 19:02:23 -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:99525 On Wed, Nov 25, 2015 at 5:52 PM, Random832 wrote: > On 2015-11-25, Ben Finney wrote: >> That is, the =E2=80=982=E2=80=99 in =E2=80=98cartesian_point =3D (2, 3)= =E2=80=99 means something different >> than in =E2=80=98cartesian_point =3D (3, 2)=E2=80=99. >> >> Whereas the =E2=80=982=E2=80=99 in =E2=80=98test_scores =3D [2, 3]=E2=80= =99 means exactly the same as in >> =E2=80=98test_scores =3D [3, 2]=E2=80=99. >> >> If each position in the sequence gives the value there a different >> menaning, use a tuple; if not, use a list. > > I don't think that's really right. The absence of first-class > multisets in python does mean that lists get "abused" for that > purpose, but I don't think that means that there's no legitimate > use-case for a list (i.e. a mutable sequence in which position is > significant). > > The difference between a tuple and a list is that one is mutable > and the other is not. The difference you are describing is > between a list and a multiset (or a tuple and an immutable > multiset). I think that Ben was actually trying to make a distinction between heterogeneity and homogeneity of the contents, not a distinction of whether the collection was ordered or not. You can of course have a homogeneous collection for which order is still important, e.g. a batting line-up.