Idiosyncratic python

Laura Creighton lac at
Thu Sep 24 23:08:58 CEST 2015

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...

A student today had a similar version of this one:

Every time he wanted to change the value of dictionary mapping he would
w={'key': new_value}


More information about the Python-list mailing list