Skip to content

[tkinter] Remove _WhatToCount alias#14793

Closed
donbarbos wants to merge 1 commit intopython:mainfrom
donbarbos:tkinter-remove-WhatToCount
Closed

[tkinter] Remove _WhatToCount alias#14793
donbarbos wants to merge 1 commit intopython:mainfrom
donbarbos:tkinter-remove-WhatToCount

Conversation

@donbarbos
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Akuli
Copy link
Copy Markdown
Collaborator

Akuli commented Sep 26, 2025

I suspect this won't actually make things better for IDE users. Can someone using vscode try this and show a screenshot of how the signature appears?

(I'm asking about vscode specifically for two reasons: it is used a lot with Python, and people usually program with tkinter before they are advanced enough to dislike vscode for one reason or another.)

@Avasam
Copy link
Copy Markdown
Collaborator

Avasam commented Sep 26, 2025

@Akuli Using Pylance as the language server (I specify because ty will actually be a thing very soon):

Before:
image
image

This PR:
image
image

As I would expect, it changes the rendered signature but autocomplete stays the same.

My opinion: Such aliases aren't meant for user visibility as much as they are to avoid repeating very large unions in stubs and/or to keep them in sync (or even establish a relationship between multiple params/attributes in that they all follow the same expected types)

@Akuli
Copy link
Copy Markdown
Collaborator

Akuli commented Sep 29, 2025

I see: the usability improves much less than I expected, and the error messages are somewhat messy in any case. So IMO this is not worth doing.

@donbarbos: Thanks for working on this, even though I chose not to merge.

@Akuli Akuli closed this Sep 29, 2025
@donbarbos donbarbos deleted the tkinter-remove-WhatToCount branch February 25, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants