Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions datascience/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import functools
import math
import collections
from collections.abc import Iterable

# Change matplotlib formatting. TODO incorporate into a style?
plt.rcParams['patch.force_edgecolor'] = True
Expand Down Expand Up @@ -261,11 +262,11 @@ def objective(args):
else:
return result.x

def is_non_string_iterable(value):
def is_non_string_iterable(value: object)-> bool:
"""Returns a boolean value representing whether a value is iterable."""
if isinstance(value, str):
return False
if hasattr(value, '__iter__'):
if isinstance(value, Iterable):
return True
return False

Loading