[tkinter.ttk] Added type annotations for Style, fix some other incomplete parts#14348
[tkinter.ttk] Added type annotations for Style, fix some other incomplete parts#14348Akuli merged 16 commits intopython:mainfrom
Style, fix some other incomplete parts#14348Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Is this a stubtest bug? It says But on line 137, it has no default argument... It also seems to concatenate the overloaded functions' signatures together as it infers the signatue in the stub to be:
|
This comment has been minimized.
This comment has been minimized.
|
For the |
| # (I'm not sure if this is the best way to handle this - ignoring the | ||
| # stubtest error would result in stubs that actually match the code) | ||
| _default_image: tkinter._ImageSpec, | ||
| *imagespec: _ImageStatespec, |
There was a problem hiding this comment.
Kinda awkward but you could do *imagespec: *tuple[tkinter._ImageSpec, *tuple[_ImageStatespec, ...]]. Not sure if this would be problematic to use though for code completion though.
There was a problem hiding this comment.
I think you should just ignore the stubtest error.
|
Sorry about taking so long to get to this. First I was going to go through this in full detail, but eventually I realized I don't know anywhere near enough about ttk to do that. I'm planning to trust you that this is correct enough, and just merge once CI is green. |
|
Diff from mypy_primer, showing the effect of this PR on open source code: discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/hybrid.py:508: error: Overlap between argument names and ** TypedDict items: "description", "name" [misc]
+ discord/ext/commands/hybrid.py:508: error: Overlap between argument names and ** TypedDict items: "name", "description" [misc]
- discord/ext/commands/hybrid.py:629: error: Overlap between argument names and ** TypedDict items: "description", "name" [misc]
+ discord/ext/commands/hybrid.py:629: error: Overlap between argument names and ** TypedDict items: "name", "description" [misc]
- discord/ext/commands/hybrid.py:834: error: Overlap between argument names and ** TypedDict items: "with_app_command", "name" [misc]
+ discord/ext/commands/hybrid.py:834: error: Overlap between argument names and ** TypedDict items: "name", "with_app_command" [misc]
- discord/ext/commands/hybrid.py:858: error: Overlap between argument names and ** TypedDict items: "with_app_command", "name" [misc]
+ discord/ext/commands/hybrid.py:858: error: Overlap between argument names and ** TypedDict items: "name", "with_app_command" [misc]
- discord/ext/commands/hybrid.py:883: error: Overlap between argument names and ** TypedDict items: "with_app_command", "name" [misc]
+ discord/ext/commands/hybrid.py:883: error: Overlap between argument names and ** TypedDict items: "name", "with_app_command" [misc]
- discord/ext/commands/hybrid.py:935: error: Overlap between argument names and ** TypedDict items: "with_app_command", "name" [misc]
+ discord/ext/commands/hybrid.py:935: error: Overlap between argument names and ** TypedDict items: "name", "with_app_command" [misc]
- discord/ext/commands/bot.py:290: error: Overlap between argument names and ** TypedDict items: "with_app_command", "name" [misc]
+ discord/ext/commands/bot.py:290: error: Overlap between argument names and ** TypedDict items: "name", "with_app_command" [misc]
- discord/ext/commands/bot.py:314: error: Overlap between argument names and ** TypedDict items: "with_app_command", "name" [misc]
+ discord/ext/commands/bot.py:314: error: Overlap between argument names and ** TypedDict items: "name", "with_app_command" [misc]
|
Akuli
left a comment
There was a problem hiding this comment.
As I mentioned, I'm not familiar enough with ttk to check everything in full detail, but this certainly looks like an improvement to me.
tkinter.ttk.Stylesetup_master,Panedwindow.forget)