Serhiy Storchaka added the comment:
The update() method returns None. This is a correct behavior.
The rationale is the same as for list.sort(), see
https://docs.python.org/3/faq/design.html#why-doesn-t-list-sort-return-the-sorted-list.
--
nosy:
Eric V. Smith added the comment:
dict.update() returns None, so this is expected. Maybe you want:
>>> x = {"X":123}
>>> x.update({"abc":123})
>>> x
{'X': 123, 'abc': 123}
>>>
--
nosy: +eric.smith
resolution: -> not a bug
stage: -> resolved
status: open -> closed
New submission from Martin :
>>> x = {"x":123}.update({"abc":123})
>>> type(x)
--
messages: 306977
nosy: thedemz
priority: normal
severity: normal
status: open
title: Dict creation with update will result to NoneType
type: behavior
versions: Python 3.6