Skip to content

bpo-36396: Remove fgBg param of idlelib.config.GetHighlight() - #12491

Merged
terryjreedy merged 6 commits into
python:masterfrom
terryjreedy:fgbg
Mar 22, 2019
Merged

bpo-36396: Remove fgBg param of idlelib.config.GetHighlight()#12491
terryjreedy merged 6 commits into
python:masterfrom
terryjreedy:fgbg

Conversation

@terryjreedy

@terryjreedy terryjreedy commented Mar 22, 2019

Copy link
Copy Markdown
Member

This param was only used twice and changed the return type.

https://bugs.python.org/issue36396

This param was only used once and changed the return type.
@terryjreedy
terryjreedy requested a review from csabella March 22, 2019 06:14
@terryjreedy

Copy link
Copy Markdown
Member Author

Cheryl, what you you think of changing 'd' to 'hi', etc in the configdialog tests? I only changed the one test I edited.

Comment thread Lib/idlelib/config.py
Comment thread Lib/idlelib/NEWS.txt Outdated
Comment thread Misc/NEWS.d/next/IDLE/2019-03-21-22-43-21.bpo-36396.xSTX-I.rst Outdated

@csabella csabella left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this change. Some small things in other comments. I probably would have used f-strings instead of concatenation, but that's just a personal preference. :-)

Comment thread Lib/idlelib/idle_test/test_configdialog.py Outdated
@csabella

Copy link
Copy Markdown
Contributor

Cheryl, what you you think of changing 'd' to 'hi', etc in the configdialog tests? I only changed the one test I edited.

So, d was for dialog and it's on all the tests. It was a pretty clean replacement at the time to go from d = dialog to d = self.page, but the d doesn't really have a meaning anymore. Since other recent tests have used text = self.text, if I was doing this now, I'd probably use page = self.page. It's a little more readable than d. However, if each page used a unique value, such as hi, then it would be easier to see immediately which page was being tested without needing to look back at the class. I guess I'd be +0 on the change. Once you look at the source and know what d is, it makes it easy to read all the tests because it's consistent. But, there might be a slight cognitive gain from changing it.

@terryjreedy

terryjreedy commented Mar 22, 2019

Copy link
Copy Markdown
Member Author

Thanks for the fixes.

While editing, I felt that 'd' was a nuisance because I kept mentally translating it each time I read it. I thought of 'high', 'page' or 'hp' instead of 'd'. 'hi' instead of 'high' was an experiment. For the 5 test classes, 'font', 'dent', 'high', 'keys', and 'gen' could work, but don't feel completely right, especially the adjectives. I think 'page' is what I was mentally substituting for 'd'. Given your comment, I would go with that and improve some of the test names to be more page specific. For example, change 'test_builtin_name' to 'test_builtin_theme' and 'test_builtin_keys' for the respective pages. For now, I changed 'hi' to 'page' and intend to leave that for the merge.

@terryjreedy

Copy link
Copy Markdown
Member Author

I did not see the f-string comment until now. They would be fine and for anything other than name + 'string' I would change. Even f'{name1}{name2}' has the advantage over name1 + name2 of clearly resulting in a string, with some green highlighting.

@terryjreedy
terryjreedy merged commit c141957 into python:master Mar 22, 2019
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @terryjreedy for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot

Copy link
Copy Markdown

GH-12501 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 22, 2019
…GH-12491)

This param was only used once and changed the return type.
(cherry picked from commit c141957)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
miss-islington added a commit that referenced this pull request Mar 22, 2019
This param was only used once and changed the return type.
(cherry picked from commit c141957)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants