bpo-41876: Overload __repr__ for tkinter Font objects (GH-22450)

This commit is contained in:
Anatoliy Platonov 2020-10-14 13:02:51 +03:00 committed by GitHub
parent 0cafcd3c56
commit b4d895336a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View file

@ -100,6 +100,10 @@ class Font:
def __str__(self):
return self.name
def __repr__(self):
return f"<{self.__class__.__module__}.{self.__class__.__qualname__}" \
f" object {self.name!r}>"
def __eq__(self, other):
if not isinstance(other, Font):
return NotImplemented