Is there any reason to prefer using a dictionary or a key/value pair for the update method?
That you already have one, e.g. if you have a base dict and an other dict (from a constant, or a parameter) then dict1.update(dict2) makes perfect sense.
Also makes sense if you're generating the second dict dynamically e.g. dict1.update(zip(keys, values)).
Are they completely functionally equivalent or is there a 'gotcha' that one syntax might cause?
The "keyword arguments" form only works with string keys (in Python 3, in Python 2 it unintentionally worked with non-string keys as well). Even using the mapping-unpacking form. It also can not be used with literal keywords e.g.
d.update(assert=3)
is a syntax error.
More generally
The keyword form is useless on its own
It can make sense to add keywords to an update call with a positional argument e.g.
d.update(d2, key=value)
as you're already piggybacking on a call which is necessary. However
d.update(key=value)
is generally[0] just a more complicated, more limiting, and slower way of writing
d['key'] = value
```:
```sh
❯ python3 -mtimeit -s "d = {'a': 'b'}" "d.update(c='d', e='f', g='h')"
2000000 loops, best of 5: 202 nsec per loop
❯ python3 -mtimeit -s "d = {'a': 'b'}" "d['c']='d'; d['e']='f'; d['g']='h'"
5000000 loops, best of 5: 62.2 nsec per loop
I don't remember the numbers (and they probably changed with recent releases as there have been optimisations to literal dicts) but when I benched this a few years back you'd need several dozen keys before you broke even.
[0] it can be useful in the rare case where you need to update a dict in an expression context e.g. a lambda body, I don't think I've ever been in that situation