Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion stdlib/tkinter/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,9 @@ class Grid:
ipady: float | str = ...,
padx: float | str | tuple[float | str, float | str] = ...,
pady: float | str | tuple[float | str, float | str] = ...,
sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty
sticky: (
str | list[str] | tuple[str, ...]
) = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty
in_: Misc = ...,
**kw: Any, # allow keyword argument named 'in', see #4836
) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tkinter/ttk.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ class Notebook(Widget):
child: tkinter.Widget,
*,
state: Literal["normal", "disabled", "hidden"] = ...,
sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty
sticky: str | list[str] | tuple[str, ...] = ..., # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't work on my system:

>>> from tkinter import ttk
>>> nb = ttk.Notebook()
>>> label = ttk.Label(nb)
>>> nb.add(label, sticky=list('nswe'))
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    nb.add(label, sticky=list('nswe'))
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/tkinter/ttk.py", line 824, in add
    self.tk.call(self._w, "add", child, *(_format_optdict(kw)))
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: Bad -sticky specification n s w e

Maybe this has to do with Tk version? What's yours?

>>> import tkinter
>>> tkinter.TkVersion
8.6

padding: _Padding = ...,
text: str = ...,
# `image` is a sequence of an image name, followed by zero or more
Expand Down
Loading