Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39094
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <jer15@hermes.cam.ac.uk> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.022 |
| X-Spam-Evidence | '*H*': 0.96; '*S*': 0.00; 'constructor': 0.07; 'immutable': 0.09; 'instances.': 0.09; 'tuple': 0.09; 'cc:addr :python-list': 0.10; '(rather': 0.16; 'benjamin': 0.16; 'cc:name:python list': 0.16; 'hashable': 0.16; 'immutable,': 0.16; 'mechanism.': 0.16; 'namedtuple': 0.16; 'namedtuples': 0.16; "type's": 0.16; 'wrote:': 0.17; '>>>': 0.18; 'supposed': 0.21; 'tuples': 0.22; 'cc:2**0': 0.23; 'example': 0.23; 'seems': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'wonder': 0.27; 'restrict': 0.27; 'interface': 0.27; '>>>>': 0.29; 'relies': 0.29; 'though.': 0.29; 'objects': 0.29; 'expect': 0.31; 'could': 0.32; 'doubt': 0.33; 'instances': 0.33; 'values.': 0.33; 'hi,': 0.33; "can't": 0.34; 'there': 0.35; 'really': 0.36; 'message-id:@gmail.com': 0.36; 'itself': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'things': 0.38; 'little': 0.39; 'john': 0.60; 'places': 0.61; 'provide': 0.62; 'different': 0.63; 'received:ac.uk': 0.65; 'said:': 0.65; 'hoping': 0.72; '2013': 0.84; 'anywhere.': 0.84; 'oscar': 0.84; 'reid': 0.84; 'replacements': 0.84; 'factors': 0.95 |
| X-Cam-AntiVirus | no malware found |
| X-Cam-ScannerInfo | http://www.cam.ac.uk/cs/email/scanner/ |
| Date | Mon, 18 Feb 2013 14:18:49 +0000 |
| From | John Reid <johnbaronreid@gmail.com> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 |
| MIME-Version | 1.0 |
| To | Oscar Benjamin <oscar.j.benjamin@gmail.com> |
| Subject | Re: Differences creating tuples and collections.namedtuples |
| References | <7a40a426-baa9-46f8-8f9d-59ba32b044f3@googlegroups.com> <CAHVvXxQ1rmKk8djCZj-O3XhJwifHNYyR7JLTgfw_hKQzcoo=bA@mail.gmail.com> <512231CA.8070108@gmail.com> <CAHVvXxQ3aAhwe0M9pbmxr1xhzNrAu4SXbA7+5sNEgDG0iBCEyA@mail.gmail.com> |
| In-Reply-To | <CAHVvXxQ3aAhwe0M9pbmxr1xhzNrAu4SXbA7+5sNEgDG0iBCEyA@mail.gmail.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 7bit |
| Sender | "J.E. Reid" <jer15@hermes.cam.ac.uk> |
| Cc | Python List <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 | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1944.1361197131.2939.python-list@python.org> (permalink) |
| Lines | 29 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1361197131 news.xs4all.nl 6981 [2001:888:2000:d::a6]:47686 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:39094 |
Show key headers only | View raw
On 18/02/13 14:12, Oscar Benjamin wrote: > On 18 February 2013 13:51, John Reid <johnbaronreid@gmail.com> wrote: >> On 18/02/13 12:03, Oscar Benjamin wrote: >>> On 18 February 2013 11:47, John Reid <johnbaronreid@gmail.com> wrote: >>>> Hi, >>>> >>>> I was hoping namedtuples could be used as replacements for tuples in all instances. >>> namedtuples are not really intended to serves as tuples anywhere. They >>> are intended to provide lightweight, immutable, hashable objects with >>> *named* (rather than numbered) values. >> If they are not supposed to be tuples then calling them namedtuples and >> inheriting from tuple seems a little odd. > You can use namedtuple instances in places that expect tuples. > Inheriting from tuples enables them to be all the things I said: > lightweight, immutable and hashable. The type object itself has a > different interface for the constructor, though. > > Then I can't use them in every place I use tuples. For example IPython relies upon the type's interface for the constructor as part of a serialization mechanism. I wonder why they have a different interface. It seems to restrict their usability. No doubt there were other factors involved in the design of the interface. John.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Differences creating tuples and collections.namedtuples John Reid <johnbaronreid@gmail.com> - 2013-02-18 03:47 -0800
Re: Differences creating tuples and collections.namedtuples Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-18 12:03 +0000
Re: Differences creating tuples and collections.namedtuples Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-18 12:05 +0000
Re: Differences creating tuples and collections.namedtuples Dave Angel <davea@davea.name> - 2013-02-18 07:11 -0500
Re: Differences creating tuples and collections.namedtuples John Reid <johnbaronreid@gmail.com> - 2013-02-18 13:49 +0000
Re: Differences creating tuples and collections.namedtuples John Reid <johnbaronreid@gmail.com> - 2013-02-18 13:51 +0000
Re: Differences creating tuples and collections.namedtuples John Reid <j.reid@mail.cryst.bbk.ac.uk> - 2013-02-18 14:09 +0000
Re: Differences creating tuples and collections.namedtuples raymond.hettinger@gmail.com - 2013-02-18 23:48 -0800
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-19 08:06 +0000
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-19 08:57 +0000
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-19 08:06 +0000
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-19 08:05 +0000
Re: Differences creating tuples and collections.namedtuples raymond.hettinger@gmail.com - 2013-02-18 23:48 -0800
Re: Differences creating tuples and collections.namedtuples Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-18 14:15 +0000
Re: Differences creating tuples and collections.namedtuples John Reid <johnbaronreid@gmail.com> - 2013-02-18 14:18 +0000
Re: Differences creating tuples and collections.namedtuples Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-18 14:12 +0000
Re: Differences creating tuples and collections.namedtuples John Reid <j.reid@mail.cryst.bbk.ac.uk> - 2013-02-18 14:23 +0000
Re: Differences creating tuples and collections.namedtuples Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-18 14:53 +0000
Re: Differences creating tuples and collections.namedtuples John Reid <j.reid@mail.cryst.bbk.ac.uk> - 2013-02-18 15:07 +0000
Re: Differences creating tuples and collections.namedtuples Terry Reedy <tjreedy@udel.edu> - 2013-02-18 16:28 -0500
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-19 11:18 +1100
Re: Differences creating tuples and collections.namedtuples Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-02-19 01:43 +0000
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-19 14:06 +1100
Re: Differences creating tuples and collections.namedtuples Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-02-19 21:27 +1300
Re: Differences creating tuples and collections.namedtuples Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-02-19 20:54 +1300
Re: Differences creating tuples and collections.namedtuples John Reid <j.reid@mail.cryst.bbk.ac.uk> - 2013-02-19 09:30 +0000
Re: Differences creating tuples and collections.namedtuples Terry Reedy <tjreedy@udel.edu> - 2013-02-19 22:38 -0500
Re: Differences creating tuples and collections.namedtuples Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-22 10:38 +0000
Re: Differences creating tuples and collections.namedtuples Chris Angelico <rosuav@gmail.com> - 2013-02-20 17:50 +1100
Re: Differences creating tuples and collections.namedtuples Roy Smith <roy@panix.com> - 2013-02-20 09:09 -0500
Re: Differences creating tuples and collections.namedtuples Roy Smith <roy@panix.com> - 2013-02-18 20:11 -0500
Re: Differences creating tuples and collections.namedtuples alex23 <wuwei23@gmail.com> - 2013-02-18 17:47 -0800
Re: Differences creating tuples and collections.namedtuples John Reid <j.reid@mail.cryst.bbk.ac.uk> - 2013-02-19 09:36 +0000
csiph-web