From d9f41661fbee003e5a83425a38e7f403a4086b94 Mon Sep 17 00:00:00 2001 From: Andreas Maier Date: Sat, 25 Jul 2020 11:45:20 +0200 Subject: [PATCH] Removed TODOs from unimplemented lt/gt/le/ge special methods Details: * Removed the TODOs from the lt/gt/le/ge special methods as they will continue not to be supported. The type of exception (TypeError) and the exception message were already consistent with the standard dict. * Changed the internal method that raises the TypeError to have just one leading underscore. We don't need to be paranoid. Signed-off-by: Andreas Maier --- nocasedict/_nocasedict.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nocasedict/_nocasedict.py b/nocasedict/_nocasedict.py index 2efec0f..b0899aa 100644 --- a/nocasedict/_nocasedict.py +++ b/nocasedict/_nocasedict.py @@ -529,7 +529,7 @@ def __ne__(self, other): """ return not self == other - def __raise_ordering_not_supported(self, other, op): + def _raise_ordering_not_supported(self, other, op): """ Function to raise a TypeError indicating that ordering of this class is not supported. @@ -539,20 +539,16 @@ def __raise_ordering_not_supported(self, other, op): format(op, type(self), type(other))) def __lt__(self, other): - # TODO: Implement or not - see issue #10 - self.__raise_ordering_not_supported(other, '<') + self._raise_ordering_not_supported(other, '<') def __gt__(self, other): - # TODO: Implement or not - see issue #10 - self.__raise_ordering_not_supported(other, '>') + self._raise_ordering_not_supported(other, '>') def __ge__(self, other): - # TODO: Implement or not - see issue #10 - self.__raise_ordering_not_supported(other, '>=') + self._raise_ordering_not_supported(other, '>=') def __le__(self, other): - # TODO: Implement or not - see issue #10 - self.__raise_ordering_not_supported(other, '<=') + self._raise_ordering_not_supported(other, '<=') def __hash__(self): # TODO: Implement or not - see issue #10