Skip to content

Conversation

@donbarbos
Copy link
Contributor

@donbarbos donbarbos commented Jan 13, 2026

@github-actions

This comment has been minimized.

@donbarbos donbarbos marked this pull request as draft January 14, 2026 08:57
@github-actions
Copy link
Contributor

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

@donbarbos donbarbos marked this pull request as ready for review January 14, 2026 09:37
Comment on lines +1035 to +1038
@overload
def wantobjects(self) -> int: ...
@overload
def wantobjects(self, wantobjects: int, /) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

At least for Python 3.12, these are bools:

Python 3.12.3 (main, Jan  8 2026, 11:30:50) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> tkinter.Tk().wantobjects()
True
Suggested change
@overload
def wantobjects(self) -> int: ...
@overload
def wantobjects(self, wantobjects: int, /) -> None: ...
@overload
def wantobjects(self) -> bool: ...
@overload
def wantobjects(self, wantobjects: bool, /) -> None: ...

def adderrorinfo(self, msg: str, /) -> None: ...
def call(self, command: Any, /, *args: Any) -> Any: ...
def createcommand(self, name: str, func, /): ...
def createcommand(self, name: str, func: Callable[..., object], /) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you sure that func takes arbitrary arguments? Maybe @Akuli, our resident tkinter expert has some insights. We should at least leave a TODO comment to check this.

if sys.platform != "win32":
def createfilehandler(self, file, mask: int, func, /): ...
def deletefilehandler(self, file, /) -> None: ...
def createfilehandler(self, file: FileDescriptorLike, mask: int, func: Callable[..., object], /) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question here.


def createtimerhandler(self, milliseconds: int, func, /): ...
def dooneevent(self, flags: int = 0, /): ...
def createtimerhandler(self, milliseconds: int, func: Callable[..., object], /): ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

And here.

Comment on lines +60 to +65
def createcommand(self, name: str, func: Callable[..., object], /) -> None: ...
if sys.platform != "win32":
def createfilehandler(self, file, mask: int, func, /): ...
def deletefilehandler(self, file, /) -> None: ...
def createfilehandler(self, file: FileDescriptorLike, mask: int, func: Callable[..., object], /) -> None: ...
def deletefilehandler(self, file: FileDescriptorLike, /) -> None: ...

def createtimerhandler(self, milliseconds: int, func, /): ...
def deletecommand(self, name: str, /): ...
def dooneevent(self, flags: int = 0, /): ...
def createtimerhandler(self, milliseconds: int, func: Callable[..., object], /): ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

See above.

def exprlong(self, s: str, /): ...
def exprstring(self, s: str, /): ...
def evalfile(self, fileName: str, /) -> str: ...
def exprboolean(self, s: str, /) -> int: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def exprboolean(self, s: str, /) -> int: ...
def exprboolean(self, s: str, /) -> Literal[0, 1]: ...

def exprlong(self, s: str, /): ...
def exprstring(self, s: str, /): ...
def evalfile(self, fileName: str, /) -> str: ...
def exprboolean(self, s: str, /) -> int: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def exprboolean(self, s: str, /) -> int: ...
def exprboolean(self, s: str, /) -> Literal[0, 1]: ...

Comment on lines +93 to +96
@overload
def wantobjects(self) -> int: ...
@overload
def wantobjects(self, wantobjects: int, /) -> None: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@overload
def wantobjects(self) -> int: ...
@overload
def wantobjects(self, wantobjects: int, /) -> None: ...
@overload
def wantobjects(self) -> bool: ...
@overload
def wantobjects(self, wantobjects: bool, /) -> None: ...

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