mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
Merge branch 'unicodeheaders' of https://github.com/mwalling/tablib into develop
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user