Repository navigation
Replace all FloatInt arguments that have an int default - #16964
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
FloatInt arguments with an int defaultFloatInt arguments that have an int default
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Akuli
approved these changes
Dec 3, 2026
Akuli
left a comment
Collaborator
There was a problem hiding this comment.
This seems like a reasonable approach to me, and I don't think it's going to make anything less correct than before. I reviewed the tkinter changes in more detail.
| variable: Variable | Literal[""] = ..., | ||
| width: FloatInt | str = 0, | ||
| wraplength: FloatInt | str = 0, | ||
| width: float | int | str = 0, |
Collaborator
There was a problem hiding this comment.
width and height are wrong for tkinter.Checkbutton and tkinter.Radiobutton. This means that the stubs were wrong before, not that the approach of this PR would be somehow wrong.
>>> import tkinter
>>> tkinter.Checkbutton(width=5.6)
Traceback (most recent call last):
File "<python-input-2>", line 1, in <module>
tkinter.Checkbutton(width=5.6)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/usr/lib/python3.13/tkinter/__init__.py", line 3203, in __init__
Widget.__init__(self, master, 'checkbutton', cnf, kw)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/tkinter/__init__.py", line 2777, in __init__
self.tk.call(
~~~~~~~~~~~~^
(widgetName, self._w) + extra + self._options(cnf))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: expected integer but got "5.6"
I think it's cleanest to fix this afterwards in another PR, so that this one remains purely auto-generated.
Collaborator
Author
There was a problem hiding this comment.
@Akuli Do you want to write the PR and I review?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
float | int, because these obviously also acceptint.