Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Completely Empty by Bronepoezd
from collections import Iterable
def completely_empty(val):
if isinstance(val, Iterable):
if isinstance(val, str):
# only '' is accepted
return not(val)
# A wellfounded iterable is completely empty when all its elements
# are completely empty.
return all(completely_empty(x) for x in val)
# a non-iterable is never completely empty
return False
July 14, 2017
Comments: