On 24 February 2014 15:01, Ron Adam <ron3200@gmail.com> wrote:
You would probably see it used more often like this...
def names(defaults, pos_names, pos_args, kwds): return {}.=update(defaults) \ .=update(zip(pos_names, pos_args) \ .=update(kwds)
How is this better than def names(defaults, pos_names, pos_args, kwds): ret = {} ret.update(defaults) ret.update(zip(pos_names, pos_args) ret.update(kwds) return ret (I originally named the return value _ to cater for the tendency to insist on punctuation rather than names in this thread, but honestly, why *not* name the thing "ret"?) I get the idea of chained updates, I really do. But translating between mutation of a named value and chained updates is pretty trivial, so I don't see how this is anything but a case of "follow the preferred style for the language/API you're using". And Python uses updating named values, why is that so bad? Paul