-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
bpo-33768: IDLE: Clicking on code context line moves it to top of editor #7411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I expect to merge this tomorrow after I finish reviewing. |
terryjreedy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the yview arg to f'{n}.0'.
-
I don't like passing floats as indexes, because A) they are not. They usually work because _tkinter calls str(float), but B) this is potentially fragile; for instance, float(3*.1) == 0.30000000000000004. We now C. have f-strings in addition to %-formatting as a way to create a string index. Both are D. 50% faster than str(float(n)). I prefer f-strings as the clearest way to make an index string.
-
I like yview(int) even less than yview(float). A. Having yview(n+1) = yview(float(n)) is wretched. This made the tests confusing. B. the tk doc calls it obsolete. It could disappear from tkinter, as has happened with other obsolete tk features.
Otherwise, this is great. Thanks for the PR.
|
Thanks @csabella for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
|
GH-7515 is a backport of this pull request to the 3.7 branch. |
…tor (pythonGH-7411) (cherry picked from commit 041272b) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
|
GH-7516 is a backport of this pull request to the 3.6 branch. |
…tor (pythonGH-7411) (cherry picked from commit 041272b) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
|
|
IDLE has had multiple authors, without a tkinter style guide ;-). I could see using the float trick when the alternative was % or .format, even though I did not like it, but then I realized that we have the new option since 3.6 that I like even better. So I did the timing test. While float alone is faster than f-string, _tkinter has to apply str, and the combination is slower., and I am fairly sure it still is even in C (where the lookup of 'str' is done at compile time). There is also a matter of consistency. If row and column are known constants, such as 1 and 5 in the test, writing |
https://bugs.python.org/issue33768