[pyfr] 54/88: Implement __contains__ inside of the NativeReader class.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Nov 16 12:05:29 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository pyfr.
commit 853ef05d5a55c2b665fd3e2493aeefacdd8a7989
Author: Freddie Witherden <freddie at witherden.org>
Date: Thu Jun 23 15:44:09 2016 -0700
Implement __contains__ inside of the NativeReader class.
---
pyfr/readers/native.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyfr/readers/native.py b/pyfr/readers/native.py
index dcb76b5..258e8de 100644
--- a/pyfr/readers/native.py
+++ b/pyfr/readers/native.py
@@ -15,6 +15,9 @@ class NativeReader(Mapping):
self.fname = os.path.abspath(fname)
self._file = h5py.File(fname, 'r')
+ def __contains__(self, aname):
+ return aname in self._file
+
def __getitem__(self, aname):
ret = self._file[aname]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyfr.git
More information about the debian-science-commits
mailing list