Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19675 > unrolled thread

Re: 'class' named tuple

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-01-31 18:15 -0700
Last post2012-01-31 18:15 -0700
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.


Contents

  Re: 'class' named tuple Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-31 18:15 -0700

#19675 — Re: 'class' named tuple

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-01-31 18:15 -0700
SubjectRe: 'class' named tuple
Message-ID<mailman.5278.1328058940.27778.python-list@python.org>
On Tue, Jan 31, 2012 at 5:54 PM, Emmanuel Mayssat <emayssat@gmail.com> wrote:
> I have the following program.
> I am trying to have index the attributes of an object using __getitem__.
> Reading them this way works great, but assigning them a value doesn't
> Is there a way to do such a thing?

For assignment, use __setitem__.

Cheers,
Ian

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web