Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #97092
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail |
|---|---|
| Return-Path | <lac@openend.se> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.015 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'python': 0.10; 'thursday,': 0.13; 'subject:python': 0.14; 'thu,': 0.15; '24,': 0.16; '>on': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message- id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'wrote:': 0.16; 'laura': 0.18; 'student': 0.20; '2015': 0.20; 'to:2**1': 0.21; 'sep': 0.22; 'to:no real name:2**1': 0.27; '-0700,': 0.29; 'dictionary': 0.29; 'received:se': 0.29; "d'aprano": 0.33; 'steven': 0.33; 'similar': 0.33; 'skip:d 20': 0.34; 'mapping': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'wanted': 0.37; 'version': 0.38; 'to:addr:python.org': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.61; 'today': 0.65; 'batchelder': 0.84; 'header:In-reply-to:1': 0.84; 'utc-4,': 0.84; 'write:': 0.91; 'not:': 0.93 |
| To | python-list@python.org, lac@openend.se |
| From | Laura Creighton <lac@openend.se> |
| Subject | Re: Idiosyncratic python |
| In-reply-to | <00884c56-4c94-406b-9902-b94dda9d66b3@googlegroups.com> |
| References | <560391ea$0$2885$c3e8da3$76491128@news.astraweb.com> <00884c56-4c94-406b-9902-b94dda9d66b3@googlegroups.com> |
| Comments | In-reply-to Ned Batchelder <ned@nedbatchelder.com> message dated "Thu, 24 Sep 2015 13:46:27 -0700." |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset="us-ascii" |
| Content-ID | <26849.1443128938.1@fido> |
| Date | Thu, 24 Sep 2015 23:08:58 +0200 |
| X-Greylist | Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Thu, 24 Sep 2015 23:09:01 +0200 (CEST) |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.144.1443128954.28679.python-list@python.org> (permalink) |
| Lines | 25 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1443128954 news.xs4all.nl 23823 [2001:888:2000:d::a6]:53593 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:97092 |
Show key headers only | View raw
In a message of Thu, 24 Sep 2015 13:46:27 -0700, Ned Batchelder writes:
>On Thursday, September 24, 2015 at 2:02:38 AM UTC-4, Steven D'Aprano wrote:
>> What are your favorite not-wrong-just-weird Python moments?
>
>I've seen this a number of times:
>
> dict_of_values.update({'key': some_value})
>
>why not:
>
> dict_of_values['key'] = some_value
>
>I've considered writing a Pylint plugin to flag these...
>
>--Ned.
A student today had a similar version of this one:
Every time he wanted to change the value of dictionary mapping he would
write:
w={'key': new_value}
dict_of_values.update(w)
Laura
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Idiosyncratic python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-09-24 16:02 +1000
Re: Idiosyncratic python Paul Rubin <no.email@nospam.invalid> - 2015-09-23 23:16 -0700
Re: Idiosyncratic python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-09-24 16:35 +1000
Re: Idiosyncratic python Ben Finney <ben+python@benfinney.id.au> - 2015-09-24 16:54 +1000
Re: Idiosyncratic python Steven D'Aprano <steve@pearwood.info> - 2015-09-25 11:08 +1000
Re: Idiosyncratic python Terry Reedy <tjreedy@udel.edu> - 2015-09-24 02:54 -0400
Re: Idiosyncratic python wxjmfauth@gmail.com - 2015-09-24 00:06 -0700
Re: Idiosyncratic python Laurent Pointal <laurent.pointal@free.fr> - 2015-09-24 19:50 +0200
Re: Idiosyncratic python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-24 21:05 +0100
Re: Idiosyncratic python jmp <jeanmichel@sequans.com> - 2015-09-24 11:12 +0200
Re: Idiosyncratic python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-24 14:09 +0100
Re: Idiosyncratic python jmp <jeanmichel@sequans.com> - 2015-09-24 16:07 +0200
Re: Idiosyncratic python Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-24 08:26 -0600
Re: Idiosyncratic python Chris Angelico <rosuav@gmail.com> - 2015-09-25 02:57 +1000
Re: Idiosyncratic python jmp <jeanmichel@sequans.com> - 2015-09-24 20:04 +0200
Re: Idiosyncratic python Ian Kelly <ian.g.kelly@gmail.com> - 2015-09-24 12:19 -0600
Re: Idiosyncratic python Ned Batchelder <ned@nedbatchelder.com> - 2015-09-24 13:46 -0700
Re: Idiosyncratic python Laura Creighton <lac@openend.se> - 2015-09-24 23:08 +0200
Re: Idiosyncratic python Chris Angelico <rosuav@gmail.com> - 2015-09-25 07:49 +1000
Re: Idiosyncratic python Steven D'Aprano <steve@pearwood.info> - 2015-09-25 10:55 +1000
Re: Idiosyncratic python sohcahtoa82@gmail.com - 2015-09-24 15:32 -0700
Re: Idiosyncratic python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-09-25 00:40 +0100
Re: Idiosyncratic python Akira Li <4kir4.1i@gmail.com> - 2015-09-25 03:04 +0300
Re: Idiosyncratic python Steven D'Aprano <steve@pearwood.info> - 2015-09-25 10:08 +1000
csiph-web