Skip to content

Commit cf3b796

Browse files
committed
allow creating a Session from any object having a .items method (e.g. another Session)
1 parent f2fc81a commit cf3b796

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

larray/core/session.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ def __init__(self, *args, **kwargs):
9595
# assume a0 is a filename
9696
self.load(a0)
9797
else:
98-
items = a0.items() if isinstance(a0, dict) else a0
99-
# assume we have an iterable of tuples
100-
for k, v in items:
101-
self[k] = v
98+
# iterable of tuple or dict-like
99+
self.update(a0)
102100
else:
103101
self.add(*args, **kwargs)
104102

0 commit comments

Comments
 (0)