Rewrite the empty function according to the new NotLoaded

and the new NotAvailableType...
This commit is contained in:
Florent 2014-03-18 12:02:26 +01:00
commit 22606d961f

View file

@ -41,8 +41,10 @@ def empty(value):
:rtype: :class:`bool`
"""
for cls in (None, NotLoaded, NotAvailable):
if value is cls:
if value is None:
return True
for cls in (NotLoadedType, NotAvailableType):
if type(value) is cls:
return True
return False