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


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

Re: Immutability and Python

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-10-29 14:18 -0600
Last post2012-10-29 14:18 -0600
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: Immutability and Python Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-29 14:18 -0600

#32420 — Re: Immutability and Python

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-10-29 14:18 -0600
SubjectRe: Immutability and Python
Message-ID<mailman.3045.1351541921.27098.python-list@python.org>
On Mon, Oct 29, 2012 at 1:36 PM, Chris Angelico <rosuav@gmail.com> wrote:
> Question: Is it clearer to take advantage of the fact that the base
> class can be an arbitrary expression?
>
> class MyImmutableClass(namedtuple('MyImmutableClass', 'field1 field2
> field3 field4')):
>
> You lose the unnecessary temporary and triplication of name, but gain
> instead a rather long line.

I think it's more readable if separated, but YMMV.

[toc] | [standalone]


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


csiph-web