This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author epaine
Recipients epaine, gpolo, serhiy.storchaka, taleinat
Date 2020-09-26.15:07:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Why would negating the font size convert it from points to pixels??

Oh... I apologise: I clearly didn't think this through. It doesn't "convert" in any sense, it just negates the font size so 16 points becomes 16 pixels. Therefore, it is practically useless (besides, a new font object would not help the user a converted value anyway) - I therefore do not wish to proceed this this part of the issue (I have removed it from the title and will remove it from the PR).

> I also think using [.equal] wouldn't add anything

I disagree and will stand by this one! While the user could easily write it themselves, I think it would be helpful to have a convenience method to check if two fonts represent the same thing that is displayed to the user. When first creating this issue, I didn't want to touch __eq__ for two reasons:
1. I didn't know how much code changing this would break (it is very hard to check for code usage of dunder methods - if you know any ways please let me know!)
2. Checking to see if the fonts are the same Tk object is also very helpful (in other, granted fewer, contexts)

For example, something like this could be used in IDLE so that if the user sets their font back to the equivalent of the default ("TkFixedFont"), the value isn't kept in the user's local config (similar to how all the other options do).

Therefore, while I would like this somehow added, I agree that adding an `equal` method that does not do the same thing as `==` is confusing (you just have to look at Java and all the confusion over using `==` on strings - a 'gotcha' for every new Java learner). However, as I said above, I am reluctant to touch __eq__. Any ideas?
Date User Action Args
2020-09-26 15:07:20epainesetrecipients: + epaine, taleinat, gpolo, serhiy.storchaka
2020-09-26 15:07:20epainesetmessageid: <>
2020-09-26 15:07:20epainelinkissue41851 messages
2020-09-26 15:07:20epainecreate