mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)
They now return NotImplemented for unsupported type of the other operand.
This commit is contained in:
parent
4c69be22df
commit
662db125cd
23 changed files with 1295 additions and 1150 deletions
|
@ -281,10 +281,14 @@ class PopupViewer:
|
|||
self.__window.deiconify()
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.__menutext == other.__menutext
|
||||
if isinstance(self, PopupViewer):
|
||||
return self.__menutext == other.__menutext
|
||||
return NotImplemented
|
||||
|
||||
def __lt__(self, other):
|
||||
return self.__menutext < other.__menutext
|
||||
if isinstance(self, PopupViewer):
|
||||
return self.__menutext < other.__menutext
|
||||
return NotImplemented
|
||||
|
||||
|
||||
def make_view_popups(switchboard, root, extrapath):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue