Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #32419
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.077 |
| X-Spam-Evidence | '*H*': 0.85; '*S*': 0.00; 'subject:Python': 0.05; 'received:mail-vb0-f46.google.com': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'oct': 0.16; 'wrote:': 0.17; 'received:209.85.212.46': 0.18; 'header:In-Reply-To:1': 0.25; 'skip:m 30': 0.26; 'am,': 0.27; 'message- id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'question:': 0.29; 'skip:_ 10': 0.29; 'class': 0.29; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'but': 0.36; 'skip:m 40': 0.36; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; '30,': 0.62; 'unnecessary': 0.65; 'skip:n 30': 0.69; 'lose': 0.71; 'gain': 0.79; 'clearer': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=iQJE0GT38QVA9GgsFgz5slDC/TA3+a9jo4GQvd58Lp0=; b=fZxA/F+doMO2MR/NpJCjAoSykNJx+wUXFMNZfSRx6b73O/kbhgJQ2LHphT358RcHXB gbsnuJRyN2dyszxoyNm1RQlOtYRlvU9rvu7S5R9+VQhIjSm0uvMI+Uw8n2geuK8Sdo7U Tt/CeZNDtq9DlmYbd6qe/ZPmuCblRH9vBdN+vD0bXq8Rj05vhRNcNn4LuW55cHRK0fwb 9T89FY9TPVAXM4pUCAiCQ4DJpfyTDvg2QfsBN3Yfw3/ECYpovM7gDETfRL/yJ7enzP+R R808y/aYtFWMocvsWRmofabc2dN4Tzn376scLnYYJlLkx+xN+RArspf+Ruiij4ZeWHo0 4sOA== |
| MIME-Version | 1.0 |
| In-Reply-To | <CALwzidmjXz4JuYRCkWtXtHtDcv7DLzFjfUUxWuopwafmTHoP-g@mail.gmail.com> |
| 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> |
| Date | Tue, 30 Oct 2012 06:36:52 +1100 |
| Subject | Re: Immutability and Python |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| 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.3044.1351539415.27098.python-list@python.org> (permalink) |
| Lines | 16 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1351539416 news.xs4all.nl 6981 [2001:888:2000:d::a6]:47693 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:32419 |
Show key headers only | View raw
On Tue, Oct 30, 2012 at 6:23 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> _MyImmutableClass = namedtuple('MyImmutableClass', 'field1 field2
> field3 field4')
>
> class MyImmutableClass(_MyImmutableClass):
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.
ChrisA
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Immutability and Python Chris Angelico <rosuav@gmail.com> - 2012-10-30 06:36 +1100 Re: Immutability and Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-29 22:34 +0000
csiph-web