Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def empty_test(list_of_iterables):
- if not list_of_iterables:
- return True
- else:
- return [*list_of_iterables[0]] == [] and empty_test(list_of_iterables[1:])
- assert empty_test(['', (), {}, iter([])]) == True
- assert empty_test(['foo']) == False
- assert empty_test([iter([])]) == True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement