Luke> example code: Luke> log = {} Luke> for t in range(5): Luke> for r in range(10): Luke> log.setdefault(r, '') += "test %d\n" % t Luke> pprint(log) Luke> instead, as the above is not possible, the following must be used: Luke> from operator import add Luke> ... Luke> ... Luke> ... Luke> add(log.setdefault(r, ''), "test %d\n" % t) Luke> ... ARGH! just checked - NOPE! add doesn't work. Luke> and there's no function "radd" or "__radd__" in the Luke> operator module. Why can't you do this? for t in range(5): for r in range(10): foo = log.setdefault(r,'') foo += "test %d\n" % t -- Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4