You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
intersection doesn't seem to perform correctly. Intersecting a simple list of strings results in [].
Simple fix was to remove the first 4 lines where there's a test for 'int', then a wrap into a tuple. Not sure what the purpose of that is for, but intersection seems to work without.
def intersection(self, *args):
"""
Produce an array that contains every item shared between all the
passed-in arrays.
"""
# if type(self.obj[0]) is int:
# a = self.obj
# else:
# a = tuple(self.obj[0])
setobj = set(self.obj)
for i, v in enumerate(args):
setobj = setobj & set(args[i])
return self._wrap(list(setobj))
The text was updated successfully, but these errors were encountered:
intersection doesn't seem to perform correctly. Intersecting a simple list of strings results in [].
Simple fix was to remove the first 4 lines where there's a test for 'int', then a wrap into a tuple. Not sure what the purpose of that is for, but intersection seems to work without.
The text was updated successfully, but these errors were encountered: