Skip to content

Delete tkinter.{Grid,Pack,Place}.content#15763

Merged
Akuli merged 5 commits into
mainfrom
tkinter-fix
May 11, 2026
Merged

Delete tkinter.{Grid,Pack,Place}.content#15763
Akuli merged 5 commits into
mainfrom
tkinter-fix

Conversation

@Akuli
Copy link
Copy Markdown
Collaborator

@Akuli Akuli commented May 11, 2026

Python 3.15+ added several things named content or foo_content to tkinter. They should be just like things named slaves or foo_slaves. This PR makes them consistent by deleting aliases named content where aliases named slaves don't exist.

I intentionally omitted the slaves aliases earlier. Nobody has complained here about it or other similar aliases. Basically, tkinter.Grid.content(widget) is just like widget.grid_content(), except that nobody uses the tkinter.Grid.content(widget) form.

The main reason for not having slaves and content aliases is that they confuse type checkers in some complex situations. For example, we already silence a bunch of errors in typeshed when doing multiple inheritance, and for whatever reason, someone might want to use similar multiple inheritance outside typeshed to create some kind of custom widget.

Some history:

@github-actions
Copy link
Copy Markdown
Contributor

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

@Akuli Akuli merged commit 3a46217 into main May 11, 2026
56 checks passed
@Akuli Akuli deleted the tkinter-fix branch May 11, 2026 15:19
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.

2 participants