Skip to content

Adding missing __setitem__ and keys() functions#728

Merged
ZedThree merged 1 commit intomasterfrom
master-py-datafile
Oct 27, 2017
Merged

Adding missing __setitem__ and keys() functions#728
ZedThree merged 1 commit intomasterfrom
master-py-datafile

Conversation

@bendudson
Copy link
Contributor

Because the enter function returns the implementation,
using

with DataFile(..) as f:
...
f["somevar"] = a

would not work; the implementations did not have setitem methods.

The DataFile class did not have a keys() function, though the
implementations did. This makes them consistent by adding a keys()
function to DataFile. This does the same as list(), but is more
consistent with the python standard containers.

Because the __enter__ function returns the implementation,
using

with DataFile(..) as f:
  ...
  f["somevar"] = a

would not work; the implementations did not have __setitem__ methods.

The DataFile class did not have a keys() function, though the
implementations did. This makes them consistent by adding a keys()
function to DataFile. This does the same as list(), but is more
consistent with the python standard containers.
@ZedThree ZedThree merged commit de83d75 into master Oct 27, 2017
@ZedThree ZedThree deleted the master-py-datafile branch October 27, 2017 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants