Skip to content

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

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

Merged
merged 6 commits into from
Mar 22, 2019

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Mar 22, 2019

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
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.

Copy link
Contributor

@csabella csabella left a comment

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. :-)

@csabella
Copy link
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
Copy link
Member Author

terryjreedy commented Mar 22, 2019

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
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
Contributor

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

@bedevere-bot
Copy link

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 <[email protected]>
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 <[email protected]>
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