aaylward/hapipy — comment on commit b501b91f37aa52039b9574a0e56c229122f94768
File:  line 0
By aaylward:

an interesting gotcha:

post_dict = dict((k,locals()[p]) for p,k in update_param_translation.iteritems() if locals().get(p)) creates an empty dictionary because locals() inside a generator refers to the variables defined inside the generator.

comprehensions are immune :)