We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf236fd commit d719d6cCopy full SHA for d719d6c
brainx/util.py
@@ -41,13 +41,13 @@ def _no_repeats_in_listlist(list_list):
41
raise ValueError('{0} is not a list of lists'.format(list_list))
42
43
def _contains_only(container, type):
44
- """check that contents of a container are all fo the same type"""
+ """check that contents of a container are all of the same type"""
45
try:
46
- # dict
47
- return all(isinstance(s, type) for s in container.values())
48
- except:
49
- # others
50
- return all(isinstance(s,type) for s in container)
+ container = container.values() # dict
+ except AttributeError:
+ pass
+
+ return all(isinstance(s, type) for s in container)
51
52
def listlist_to_listset(list_list):
53
""" converts list of lists to a list of sets (with check)
0 commit comments