diff --git a/tablib/core.py b/tablib/core.py index e4ceee1..658fd10 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -54,7 +54,7 @@ class Dataset(object): def __getitem__(self, key): - if is_string(key): + if isinstance(key, basestring): if key in self.headers: pos = self.headers.index(key) # get 'key' index from each data return [row[pos] for row in self._data] diff --git a/tablib/helpers.py b/tablib/helpers.py index b64d4b6..f20700d 100644 --- a/tablib/helpers.py +++ b/tablib/helpers.py @@ -14,12 +14,7 @@ class Struct(object): def piped(): - """Returns piped input via stdin, else False""" + """Returns piped input via stdin, else False.""" with sys.stdin as stdin: return stdin.read() if not stdin.isatty() else None - -def is_string(obj): - """Tests if an object is a string""" - - return True if type(obj).__name__ == 'str' else False \ No newline at end of file