mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-41876: Overload __repr__ for tkinter Font objects (GH-22450)
This commit is contained in:
parent
0cafcd3c56
commit
b4d895336a
4 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue