Skip to content

add types to most common tkinter.Entry methods - #5586

Merged
Akuli merged 3 commits into
python:masterfrom
Akuli:entry
Jun 7, 2021
Merged

Akuli merged 3 commits into
python:masterfrom
Akuli:entry

Conversation

@Akuli

@Akuli Akuli commented Jun 6, 2021 •

Copy link
Copy Markdown
Collaborator

In a bit of a hurry, want to get this done before next mypy release :)

@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jun 6, 2021

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

porcupine (https://github.com/Akuli/porcupine.git)
+ porcupine/plugins/find.py:155: error: unused "type: ignore" comment
+ porcupine/plugins/find.py:158: error: unused "type: ignore" comment
+ porcupine/plugins/find.py:226: error: unused "type: ignore" comment
+ porcupine/plugins/find.py:315: error: unused "type: ignore" comment
+ porcupine/plugins/find.py:335: error: unused "type: ignore" comment
+ porcupine/plugins/pluginmanager.py:71: error: unused "type: ignore" comment
+ porcupine/plugins/pluginmanager.py:73: error: unused "type: ignore" comment
+ porcupine/plugins/pastebin.py:159: error: unused "type: ignore" comment
+ porcupine/plugins/pastebin.py:177: error: unused "type: ignore" comment

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks reasonable. scan_mark and scan_dragto return None, and x is an int? (that's what Text uses).

Also you might be too late for mypy release :-( python/mypy#10537 (comment)

@Akuli

Akuli commented Jun 7, 2021

Copy link
Copy Markdown
Collaborator Author

I didn't do scan_mark and scan_dragto in this PR, because I originally wanted to focus on methods that I have actually seen being used; this ended up being almost every method. I'm merging this now in the hope that it magically ends up in the new mypy, but I'll likely add scan_mark and scan_dragto later.

@Akuli
Akuli merged commit ec80fda into python:master Jun 7, 2021
@Akuli
Akuli deleted the entry branch June 7, 2021 08:55
Akuli added a commit to Akuli/typeshed that referenced this pull request Jun 10, 2021
* most common tkinter.Entry methods

* type-ignore tkinter's lsp violation
@Akuli

Akuli commented Jun 10, 2021

Copy link
Copy Markdown
Collaborator Author

Perhaps it wasn't too late after all: python/mypy#10621

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