[Just van Rossum] > I sometimes use an idiom like > > def dictfromkeywords(**kwargs): > return kwargs > > d = dictfromkeywords( > akey = 12, > anotherkey = "foo", > ...etc. > ) > +1 So far everyone who has responded to this idea has admitted they have code somewhere the operates like this. > to conveniently build dicts with literal keys. I think I've seen Alex Martelli > advertise it, too. Don't know how well known it is otherwise, but it is extremly > handy. > I think Alex has it in the Cookbook. -Brett
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