where using assignment expressions won't scale like that; the closest you could get would be to comma-separate:
(newdict := dict1.copy()).update(dict2), newdict.update(dict3)
or without the additional update
s (which would make a temporary tuple
tuple of the None
results froms, but with truthiness testing of each updateNone
, thrown away immediately after) result:
(newdict := dict1.copy()).update(dict2), or newdict.update(dict3)
either of which is obviously much uglier, on top of theand includes further inefficiencies (either a wasted temporary tuple
of None
s for comma separation, or pointless truthiness testing of each update
's None
return for or
separation).