Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #69761
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <jeanpierreda@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.066 |
| X-Spam-Evidence | '*H*': 0.87; '*S*': 0.00; 'interpreter': 0.05; 'whole.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'at.': 0.16; 'hashable': 0.16; 'mutable': 0.16; 'unhashable': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'variable': 0.18; 'example': 0.22; 'programming': 0.22; 'putting': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'agreed.': 0.31; 'context.': 0.31; 'ok.': 0.31; 'tuples': 0.31; 'another': 0.32; 'totally': 0.33; 'could': 0.34; 'common': 0.35; 'no,': 0.35; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'false': 0.36; 'useful': 0.36; 'subject:?': 0.36; 'easily': 0.37; 'sometimes': 0.38; 'pm,': 0.38; 'even': 0.60; 'break': 0.61; 'entire': 0.61; "you're": 0.61; 'such': 0.63; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'legal': 0.71; 'behavior': 0.77; 'compare:': 0.84; 'fragment': 0.84; 'subject:good': 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 :cc:content-type; bh=7NuCtbj35wYjTI45STdXj8x1UVG0z1PAqUIsdjOA8dI=; b=xEeCOxlRnFHB5Xdz9WLmDTHJTeLyDelSgW3ehpkTK/XKcBv0ydrtphhZHU19G+PubM A1uQon4Py49Pe33ZN2CJU5rgYpPpZzk65ZO53dCYzbpE+cXRaS0Kah7Z6+JGi/SqoUTk D7s8vFN7VI5e1BZgXPq27JIUOYGbKbLmitiOS9ntol4p81d07MVSueciPY0z7JW1dRPY ZwvLbBGQahLxqKUm0uO/CUO2784HlrmVKzld9A6t74Dcjgw3gFOu8FQUUtmVZVI8XC0z 3vGLhGJXfl77r/VkPWcfgS52Dnv00vhxfQPLVOLTNXK8ABbBrIW9UWd5z55LDgmRKjLf DBOw== |
| X-Received | by 10.140.91.105 with SMTP id y96mr25141193qgd.3.1396782110260; Sun, 06 Apr 2014 04:01:50 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <CAPTjJmqkeWO8stSDGECcvyU2217uDeZgX9gtVC+0=58195sj=A@mail.gmail.com> |
| References | <89df32f9-c8ae-4b7b-bfc4-01c574aabcae@googlegroups.com> <53410185.6050304@islandtraining.com> <CABicbJK=Fw+m9pjgm9Ng=h=if38YL6uo4ibgiA43S6ohV9XUKg@mail.gmail.com> <CAPTjJmqkeWO8stSDGECcvyU2217uDeZgX9gtVC+0=58195sj=A@mail.gmail.com> |
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
| Date | Sun, 6 Apr 2014 04:01:10 -0700 |
| Subject | Re: Mutable objects inside tuples - good or bad? |
| To | Chris Angelico <rosuav@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Cc | "comp.lang.python" <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.8947.1396782118.18130.python-list@python.org> (permalink) |
| Lines | 28 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1396782118 news.xs4all.nl 2869 [2001:888:2000:d::a6]:43235 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:69761 |
Show key headers only | View raw
On Sun, Apr 6, 2014 at 1:25 AM, Chris Angelico <rosuav@gmail.com> wrote: > On Sun, Apr 6, 2014 at 5:55 PM, Devin Jeanpierre <jeanpierreda@gmail.com> wrote: >> Agreed. Putting mutable objects inside tuples is common and totally OK. > > There are many programming habits that can cause problems, even though > they won't break Python and are legal code. :) Yes, but this isn't one of them. >> c is such that you could have another variable d, where the following >> interpreter session fragment is easily possible: >> >>>>> c == d >> True >>>>> foo(c) >>>>> c == d >> False > > What you're looking at here is hashability, not mutability. Compare: No, that is not what I am looking at. There are hashable objects with the property I described, and unhashable objects without it. My point in that example was that sometimes it is more useful to talk about entire objects and their behavior as a whole. Calling the object "immutable" when it has mutable state is misleading in this context. -- Devin
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Mutable objects inside tuples - good or bad? John Ladasky <john_ladasky@sbcglobal.net> - 2014-04-05 23:53 -0700
Re: Mutable objects inside tuples - good or bad? Gary Herron <gary.herron@islandtraining.com> - 2014-04-06 00:25 -0700
Re: Mutable objects inside tuples - good or bad? Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-04-06 00:55 -0700
Re: Mutable objects inside tuples - good or bad? Rustom Mody <rustompmody@gmail.com> - 2014-04-06 08:07 -0700
Re: Mutable objects inside tuples - good or bad? Chris Angelico <rosuav@gmail.com> - 2014-04-06 18:25 +1000
Re: Mutable objects inside tuples - good or bad? Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-04-06 04:01 -0700
Re: Mutable objects inside tuples - good or bad? Paul Kölle <paul@subsignal.org> - 2014-04-07 17:26 +0200
Re: Mutable objects inside tuples - good or bad? Chris Angelico <rosuav@gmail.com> - 2014-04-08 01:44 +1000
Re: Mutable objects inside tuples - good or bad? Paul Kölle <paul@subsignal.org> - 2014-04-07 21:46 +0200
Re: Mutable objects inside tuples - good or bad? Chris Angelico <rosuav@gmail.com> - 2014-04-08 08:47 +1000
Re: Mutable objects inside tuples - good or bad? Terry Reedy <tjreedy@udel.edu> - 2014-04-07 20:16 -0400
Re: Mutable objects inside tuples - good or bad? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-08 02:53 +0000
csiph-web