From ab930631760d61da34d0df7ba8eb5c79ebaaffe4 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 18 Dec 2017 05:14:44 -0800 Subject: [PATCH] Remove override of UserDict.get() to avoid reimplementation Reimplements the parent class implementation. Can simplify classes by removing it. https://github.com/python-ldap/python-ldap/pull/136 --- Lib/ldap/cidict.py | 6 ------ Lib/ldap/schema/models.py | 6 ------ 2 files changed, 12 deletions(-) diff --git a/Lib/ldap/cidict.py b/Lib/ldap/cidict.py index fdfba4b..f7e8d39 100644 --- a/Lib/ldap/cidict.py +++ b/Lib/ldap/cidict.py @@ -44,12 +44,6 @@ def has_key(self,key): def __contains__(self,key): return IterableUserDict.__contains__(self, key.lower()) - def get(self,key,failobj=None): - try: - return self[key] - except KeyError: - return failobj - def keys(self): return self._keys.values() diff --git a/Lib/ldap/schema/models.py b/Lib/ldap/schema/models.py index 84054f8..c1362a9 100644 --- a/Lib/ldap/schema/models.py +++ b/Lib/ldap/schema/models.py @@ -679,12 +679,6 @@ def has_key(self,nameoroid): k = self._at2key(nameoroid) return k in self.data - def get(self,nameoroid,failobj): - try: - return self[nameoroid] - except KeyError: - return failobj - def keys(self): return self._keytuple2attrtype.values()