1. Am I the only one that really loves that `print` is a statement and not a function? Call me lazy, but I don't mind not having to type additional parentheses.
5. Dict comprehensions can be dangerous, as keys that appear twice will be silently overridden:
elements = [('a', 1), ('b', 2), ('a', 3)]
{key: value for key, value in elements} == {'a': 3, 'b': 2}
# same happens with the dict() constructor
dict(elements) == {'a': 3, 'b': 2}
7. I see D.get(key, None)
way too often.8. Unpacking works in many situations, basically whenever a new variable is introduced.
for i, el in enumerate(['a', 'b']):
print i, el
{key: value for (key, value) in [('a', 1), ('b', 2), ('a', 3)]}
map(lambda (x, y): x + y, [(1, 2), (5, -1)])
Note: the last example (`lambda`) requires parentheses in `(x, y)`, as `lambda x, y:` would declare a two-argument function, whereas `lambda (x, y):` is a one-argument function, that expects the argument to be a 2-tuple.