Rewrite the empty function according to the new NotLoaded
and the new NotAvailableType...
This commit is contained in:
parent
fc6f7d8c21
commit
22606d961f
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue