Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #52358 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-08-11 05:38 +0100 |
| Last post | 2013-08-11 05:38 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python Basic Doubt Chris Angelico <rosuav@gmail.com> - 2013-08-11 05:38 +0100
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-08-11 05:38 +0100 |
| Subject | Re: Python Basic Doubt |
| Message-ID | <mailman.465.1376195940.1251.python-list@python.org> |
On Sun, Aug 11, 2013 at 5:04 AM, Joshua Landau <joshua@landau.ws> wrote: > On 11 August 2013 04:43, Chris Angelico <rosuav@gmail.com> wrote: >> The >> distinction between the two is important when the objects are mutable >> (so they have an identity that's distinct from their current values). > > I don't follow this argument. Tuples are immutable yet you're crazy if > you check their equality with "is". In Python identity and equality > are very distinct. True, it's not strictly an issue of mutability of that one level. But anything that's truly immutable (a tuple/frozenset of ints/strings) can in theory be interned. In some languages (no Pythons as far as I'm aware, though one could easily do so and still be fully compliant), all strings are automatically interned, so there's no difference between value and identity for them. A tuple containing a list, for instance, needs its identity; a tuple of three integers is identifiable entirely by its value. ChrisA
Back to top | Article view | comp.lang.python
csiph-web