Dictionary update method in Python 3.4 -
the update(...) method dictionary (see doc) has optional argument other.
i understand when argument dictionary. if don't put argument, nothing.
>>> = {'1':'first', '2':'second'} >>> {'2': 'second', '1': 'first'} >>> a.update() >>> {'2': 'second', '1': 'first'} what don't understand why optional argument, , not compulsory one.
there no point in doing a.update() no arguments, or wrong somewhere? thought maybe trick passing iterable of key/value pairs instead of dictionary argument.
Comments
Post a Comment