Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) Date: Thu, 26 Nov 2015 00:44:38 +1100 Lines: 24 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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de mqJscde07mAm9QZDwrTMIQUlSllDw69lKhSINK+qM2iQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'collections': 0.09; 'semantics': 0.09; 'tuple': 0.09; 'tuple.': 0.09; 'way:': 0.09; 'subject: \n ': 0.15; 'thu,': 0.15; 'distinction': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'immutability': 0.16; 'mutability': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'two).': 0.16; 'wrote:': 0.16; 'basically': 0.18; 'element': 0.18; 'instance,': 0.18; '(in': 0.18; 'language': 0.19; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'tuples': 0.22; 'am,': 0.23; 'second': 0.24; 'header:In-Reply-To:1': 0.24; 'message- id:@mail.gmail.com': 0.27; '(such': 0.27; 'tend': 0.27; 'dimensions': 0.29; 'types.': 0.29; 'typically': 0.29; 'putting': 0.30; 'regardless': 0.31; 'another': 0.32; 'related': 0.32; 'generally': 0.32; 'align': 0.33; 'values.': 0.33; '(for': 0.34; 'lists': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'nov': 0.35; 'but': 0.36; 'instead': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'things': 0.38; 'difference': 0.38; 'received:209': 0.38; 'represent': 0.38; 'data': 0.39; 'does': 0.39; 'subject:-': 0.39; 'where': 0.40; 'still': 0.40; 'more': 0.63; 'different': 0.63; 'between': 0.65; 'fact,': 0.67; 'records,': 0.67; '26,': 0.72; 'grow': 0.75; 'chrisa': 0.84; 'enforces': 0.84; 'fifty': 0.84; 'typically,': 0.84; 'shopping': 0.87; 'to:none': 0.91 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:cc :content-type; bh=WGo+lkk+FKeznCQTQsiN65j0TzDDS8eC+ATJuIADZaY=; b=Kw+AfFSgF3mo9JIk0gKOP68jk/uQwRNV7WJ+fkYyFaPvD5zS+OPRGALe8OwvALP4oZ 79GXrra0hjFh0qFJboVZnzqnaGl4LiaBzsJApwtkJhnTA1UU/QazwCI+tEjkWWI+oO0w VWJMDW+Y1ink6WujIOMkmAioU2Wy0Jx/j2CTlpo5JIdEvaoE7NUcihiIMcOjUL+/Vj8H GwvmzxLvjwjdNxPWOVCXESGReFTwr1l/x6MBnTPLkJAXInuNIbIwf9JZriR1Kwwl3abV 7bKyfsxMfVDJmd2Z2EMpjRISVr/L4SmdWIyVzoEWMdlE/ttXe0aMUPL1pc+DJb+dlx15 H+ag== X-Received: by 10.107.3.163 with SMTP id e35mr32815652ioi.157.1448459078334; Wed, 25 Nov 2015 05:44:38 -0800 (PST) In-Reply-To: <878u5mns8z.fsf@elektro.pacujo.net> 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:99450 On Thu, Nov 26, 2015 at 12:06 AM, Marko Rauhamaa wrote: > However, tuples are a way to represent records, groupings of related > values, where the semantics of each value is determined by its position > in the tuple. The members in a tuple are typically of different data > types. > > Lists are collections of values. Typically, each member of list is of > the same type. This is a distinction I generally make. Putting it another way: a list has the same meaning regardless of how many items are on it (for instance, a shopping list is still a shopping list whether it has five or fifty items on it), where a tuple is a package where each element has a specific meaning (such as Cartesian coordinates; the difference between the position (2,3) and the position (2,3,4) is not just that there's "more position" in the second one - it's a drastically different beast, living in three dimensions instead of two). Nothing in the language enforces this, but the mutability of lists does tend to align well with things that can grow and shrink, and the immutability of tuples makes them more like strings or complex numbers (in fact, a complex number is basically a tuple of two floats). ChrisA