DEV Community

Discussion on: 🐍 Beware of Python dict.get()

Collapse
 
tobiassn profile image
Tobias SN

Wouldn’t or also fail if the value was something like 0 or False?

Collapse
 
dan_m_sullivan profile image
Daniel M. Sullivan
In [1]: 0 or {}
Out[1]: {}

In [2]: False or {}
Out[2]: {}