FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`tkinter` source and docs use the word 'slave' · Issue #143754 · python/cpython · GitHub

Repository navigation

tkinter source and docs use the word 'slave' #143754

Closed

Description

Activity

  1. StanFromIreland commented on Jan 12, 2026

    Member

    There are a series of occurrences both in tkinter/__init__.py and the doc. You can find suggestions for replacements in the devguide.

  2. added
    type-bugAn unexpected behavior, bug, or error
    docsDocumentation in the Doc dir
    stdlibStandard Library Python modules in the Lib/ directory
    on Jan 12, 2026
  3. changed the title [-]Error message references slaves[/-] [+]`tkinter` source and docs use the word 'slave'[/+] on Jan 12, 2026
  4. VanshAgarwal24036 commented on Jan 13, 2026

    Contributor

    Hi, I’d like to work on this issue.

    I understand that Tk itself uses this terminology, so my plan is to focus on:

    • Updating Python-level error messages and documentation to use neutral terms
      (e.g. “child widgets”, “managed widgets”).
    • Renaming internal variables/comments where possible without changing the public API.
    • Ensuring no behavioral changes or compatibility regressions.

    I’ll start by identifying all occurrences in tkinter/init.py and the docs,
    and propose consistent replacements based on the devguide.

    Please let me know if this approach sounds good.

  5. i-make-data-sexy commented on Jan 13, 2026

    Author

    That’s fantastic. Thank you! 👏

  6. terryjreedy commented on Jan 14, 2026

    Member

    In tk and tkinters, 'slaves' refers to the geometry managed content of a container. In tk, the place, pack, and grid commands have option 'slaves'. In tkinter/__init__.py, class Misc has corresponding place/pack/grid/_slaves methods, which refer to 'slaves' in their docstring and which call tcl with the corresponding pair of strings. (Lines 1888, 1898, 2021.)

    The tcl/tk people have already dealt with this issue. Current 8.6 has a 'content' option that is a synonym for the 'slaves' option. I don't know when these were added. @serhiy-storchaka Do you have the docs or knowledge needed to find out? In 9.0, the names have been reversed, in that 'slaves' is listed as a synonym for 'content'.

    We could now add 'place_content = place_slaves', etc, synonyms. There are several others to consider. Misc has 'slaves = pack_slaves', so maybe add 'content = pack_content'. Eack of class Place, Pack, and Grid have lines like slaves = pack_slaves = Misc.pack_slaves (lines 2639, 2690, 2745). So add similar for 'content'?

    In docstrings, replace 'slaves' with 'contents' or perhaps 'contained widgets' or even 'placed/packed/gridded widgets'. We should not use 'children' because in tkinter, a_widget.children is a dict mapping child names to the widgets created by passing a_widget as master, the first argument, such as child = tkinter.Text(a_widget). Subsequent on-screen placement is a different issue from creation ancestry, and a child can be a content of more than one container.

    Once all tkinter-supported tk versions support 'content', we could change 'slaves' to 'content' in the tcl calls.

    EDIT: Docstring changes could be backported. New method names cannot, are are definitely a new feature.

  7. added 3 commits that reference this issue on Jan 14, 2026
  8. serhiy-storchaka commented on Jan 14, 2026

    Member

    I agree with @terryjreedy. The documentation part is larger, because it needs to update both docstrings and the module documentation, and we should also update the use of "master" -- in modern Tk documentation they use "container widget" in context of geometry management. "master" is also the public attribute and parameter name -- in many cases "parent" would be more correct term, but it is difficult to change API. "master" can also be used in other contexts, we should not blindly try to get rid of it.

  9. added a commit that references this issue on Jan 19, 2026
  10. added 2 commits that reference this issue on Jan 19, 2026
  11. added 4 commits that reference this issue on Jan 19, 2026
  12. added 2 commits that reference this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directorytopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL