Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) Date: Wed, 25 Nov 2015 15:53:01 +0200 Organization: A noiseless patient Spider Lines: 17 Message-ID: <874mganq2q.fsf@elektro.pacujo.net> 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 Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="10678"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18xqf56cjmEHzwK6Y6EvOSD" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:tsYGLX1yUo1jBld3yY6Sz/jBErk= sha1:X5YatQz2e1WYlhq4I5GkTJATGnA= Xref: csiph.com comp.lang.python:99453 BartC : > Using tuples in the same way that other languages implement records is > going to be difficult if you can't change the values of the fields! Guido could decide tomorrow that tuples are mutable. The decision is more or less arbitrary, and has to do with dictionary keys, I bet (not a particularly good reason). Anyway, Python has two ways to represent records: classes and tuples. Tuples are nice because they are concise and ad hoc. Often you start with a scalar value, then turn it into a tuple. After a while your handy tuple turns out a bit cumbersome to use so you convert it into an actual class. Marko