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: Thu, 26 Nov 2015 23:36:13 +0200 Organization: A noiseless patient Spider Lines: 23 Message-ID: <87egfc30ky.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> <874mganq2q.fsf@elektro.pacujo.net> <56565822$0$1617$c3e8da3$5496439d@news.astraweb.com> <87oaeh2qy0.fsf@elektro.pacujo.net> <87a8q1f9ni.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="28214"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18L11IHow6qZuUKosL7CS1C" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:96a+HCoyVz+dxeJIkLJpNiZ87dk= sha1:fKURBUz3l/75si7XgF3dyPkt7jw= Xref: csiph.com comp.lang.python:99600 Gregory Ewing : > Marko Rauhamaa wrote: >> What I'm saying is that Python does not prevent mutable keys but >> tries to do that with lists and tuples. >> >> I think Python should stop trying. > > Do you volunteer to answer all the posts from beginners complaining > that "the dict type is broken" because they used a list as a key and > then mutated it? What happened to consenting adults? Even Java (of all languages) allows lists to be keys and simply notes: Note: great care must be exercised if mutable objects are used as map keys. Marko