Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32420
| References | <CAF_E5Jbf0KJjDLV0jS-p_J9E4D8=_sPScgE+vkmkN2sMw=3aoA@mail.gmail.com> <1793477354.3492917.1351526431192.JavaMail.root@sequans.com> <CAF_E5JYRWxChJMHZc62d74Xnw88S2FhcXqot2V0hPuxfgbzbuw@mail.gmail.com> <CALwzidmjXz4JuYRCkWtXtHtDcv7DLzFjfUUxWuopwafmTHoP-g@mail.gmail.com> <CAPTjJmqddx9sz5YoYQLy5eT7rWs8FdwCrvtHcNjdqPFu6e2+fw@mail.gmail.com> |
|---|---|
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | 2012-10-29 14:18 -0600 |
| Subject | Re: Immutability and Python |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3045.1351541921.27098.python-list@python.org> (permalink) |
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.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Immutability and Python Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-29 14:18 -0600
csiph-web