Skip to content

Commit

Permalink
API Dataset.__setitem__: always set .name to key
Browse files Browse the repository at this point in the history
(unless it is an illegal variant of the key)
  • Loading branch information
christianbrodbeck committed Dec 20, 2016
1 parent 2430478 commit 0616e57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eelbrain/_data_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -5073,7 +5073,8 @@ def __setitem__(self, index, item, overwrite=True):

# coerce to data-object
if isdataobject(item) or isinstance(object, Datalist):
if item.name is None:
if (item.name is None or (item.name != index and
item.name != as_legal_dataset_key(index))):
item.name = index
elif isinstance(item, (list, tuple)):
item = Datalist(item, index)
Expand Down

0 comments on commit 0616e57

Please sign in to comment.