I'm looking at some code and came across the code
if data is not None
where data is a dictionary.
It got me thinking will data
be None
if the dictionary is empty? But I tried it on a python compiler and I got False
when I do
dict2 = {}
print(dict2 == None)
So my question is, when will dict2
be equal to None
?