mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
Removed useless is_string function.
This commit is contained in:
+1
-1
@@ -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]
|
||||
|
||||
+1
-6
@@ -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
|
||||
Reference in New Issue
Block a user