bpo-42759: Fix equality comparison of Variable and Font in Tkinter (GH-23968)

Objects which belong to different Tcl interpreters are now always
different, even if they have the same name.
(cherry picked from commit 1df56bc059)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2020-12-29 03:18:26 -08:00 committed by GitHub
parent 7bdb3e0825
commit 578caafabe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 11 deletions

View file

@ -103,7 +103,7 @@ class Font:
def __eq__(self, other):
if not isinstance(other, Font):
return NotImplemented
return self.name == other.name
return self.name == other.name and self._tk == other._tk
def __getitem__(self, key):
return self.cget(key)