Today I saw this idiomatic piece of code
def __init__(self, data=None):
self.data = data or {}
I used to write this kind of abbreviations Perl many years ago, and this is the first time I see this idiom in Python. Most of the time, I would write something like
self.data = data if data is not None else dict()
or even:
if data is None:
data = dict()
self.data = data
Is there any "official" style guide that mentions this kind of style?
I'd google for it, but I don't even know what keywords to use :-)