On Wednesday 22 October 2003 05:27 am, David Eppstein wrote: ... > Currently, I am using expressions like > > pos2d = > dict([(s,(positions[s][0]+dx*positions[s][2],positions[s][1]+dy*positions[s > ][2])) > for s in positions]) I _must_ be getting old -- it would never occur to me to write something as dense and incomprehensible (and no, removing the "dict([" would not make it much clearer). Something like: pos2d = {} for s, (x, y, delta) in positions.iteritems(): pos2d[s] = x+dx*delta, y+dy*delta seems just SO much clearer and more transparent to me. Alex
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