Merge branch 'unicodeheaders' of https://github.com/mwalling/tablib into develop

This commit is contained in:
Kenneth Reitz
2011-07-04 05:48:37 -04:00
2 changed files with 45 additions and 3 deletions
+3 -3
View File
@@ -162,7 +162,7 @@ class Dataset(object):
def __getitem__(self, key):
if isinstance(key, str):
if isinstance(key, str) or isinstance(key, unicode):
if key in self.headers:
pos = self.headers.index(key) # get 'key' index from each data
return [row[pos] for row in self._data]
@@ -182,7 +182,7 @@ class Dataset(object):
def __delitem__(self, key):
if isinstance(key, str):
if isinstance(key, str) or isinstance(key, unicode):
if key in self.headers:
@@ -741,7 +741,7 @@ class Dataset(object):
sorted.
"""
if isinstance(col, str):
if isinstance(col, str) or isinstance(col, unicode):
if not self.headers:
raise HeadersNeeded