Removed useless is_string function.

This commit is contained in:
Kenneth Reitz
2010-09-15 23:46:56 -04:00
parent 7cd82f956f
commit 49dc4a249e
2 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -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
View File
@@ -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