Consider the following two pieces of code for popping keys from a dict:
- without list comprehension
d = {'a': 1, 'b': 2, 'c': 3}
d.pop('a')
d.pop('b')
- with list comprehension
d = {'a': 1, 'b': 2, 'c': 3}
[d.pop(key) for key in ['a', 'b']]
Which one will be faster and why?