Skip to content

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jan 14, 2026

They use Tk commands with new name like "pack content instead of old "pack slaves".

Based on top of #143841.


📚 Documentation preview 📚: https://cpython-previews--143845.org.readthedocs.build/

@terryjreedy
Copy link
Member

The new stuff (on top of what is already in #143841) looks okay without closely examining every detail.

@hugovk
Copy link
Member

hugovk commented Jan 19, 2026

I suggest we also:

  • Have the *slaves() synonyms call the *content() functions instead of having separate functions. There's not much duplicate code, but there's some, and it means we won't need to make future fixes in two places. Also we're no longer testing the *slaves() paths so may introduce untested bugs.

  • Deprecates our *slaves() synonyms. TIP 581 didn't deprecate them in Tcl/Tk, but that doesn't mean we need to keep them in our interface. We do not need to set a removal date (we currently support 8.5.12 and upstream added synonyms in 8.6).

@serhiy-storchaka
Copy link
Member Author

To be nice, we should deprecate the old methods only when the new methods are available in all maintained Python versions, so the user can simply unconditionally switch to using the new methods.

Since this change is just cosmetic, there is no need to even deprecate them in code. The code written 20 years ago will continue to work.

We still test the *slaves() methods. This is why we need a separate implementation -- to notice when it stopped working on the Tk side.

…and grid_content()

They use Tk commands with new name like "pack content instead of old
"pack slaves".
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

Perhaps we could soft deprecate until then?

Anyway, thanks for the PR.

@serhiy-storchaka
Copy link
Member Author

There is no module documentation where the soft deprecation could be written.

The docstrins now say "Synonym for ...". This is an equivalent of soft deprecation. You should not use these methods in new code if you do not support Python 3.14, but you are not forced to make mass renaming. I expect that nobody will use the new methods in the next 3 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants