[h5py] 253/455: Switch to standard dict method names
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit e0538ede8a4909b63d8ef452a744cc8b772ec049
Author: andrewcollette <andrew.collette at gmail.com>
Date: Fri May 29 19:11:26 2009 +0000
Switch to standard dict method names
---
h5py/highlevel.py | 32 ++++++++++++++++++++++++--------
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index ea86873..ea9bf4b 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -132,29 +132,29 @@ class _DictCompat(object):
Contains dictionary-style compatibility methods for groups and
attributes.
"""
-
- def listnames(self):
+
+ def keys(self):
""" Get a list containing member names """
with self._lock:
return list(self)
- def iternames(self):
+ def iterkeys(self):
""" Get an iterator over member names """
with self._lock:
return iter(self)
- def listobjects(self):
- """ Get a list containing members """
+ def values(self):
+ """ Get a list containing member objects """
with self._lock:
return [self[x] for x in self]
- def iterobjects(self):
- """ Get an iterator over members """
+ def itervalues(self):
+ """ Get an iterator over member objects """
with self._lock:
for x in self:
yield self[x]
- def listitems(self):
+ def items(self):
""" Get a list of tuples containing (name, object) pairs """
with self._lock:
return [(x, self[x]) for x in self]
@@ -172,6 +172,22 @@ class _DictCompat(object):
return self[name]
return default
+ # Compatibility methods
+ def listnames(self):
+ """ Deprecated alias for keys() """
+ return self.keys()
+ def iternames(self):
+ """ Deprecated alias for iterkeys() """
+ return self.iterkeys()
+ def listobjects(self):
+ """ Deprecated alias for values() """
+ return self.values()
+ def iterobjects(self):
+ """ Deprecated alias for itervalues() """
+ return self.itervalues()
+ def listitems(self):
+ """ Deprecated alias for items() """
+ return self.items()
class Group(HLObject, _DictCompat):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list