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: 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 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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