Skip to content

Conversation

@JohnVillalovos
Copy link
Contributor

The documentation[1] for the bind() method in tkinter states that the
add parameter is a string argument.

Previously the type-hints had it as a boolean. The implementation[2]
actually supports either a bool or a str (or any "truthy") value.

  1. https://docs.python.org/3/library/tkinter.html#bindings-and-events
  2. https://github.com/python/cpython/blob/32959108f9c543e3cb9f2b68bbc782bddded6f42/Lib/tkinter/__init__.py#L1372

Fixes #6332

The documentation[1] for the `bind()` method in tkinter states that the
`add` parameter is a string argument.

Previously the type-hints had it as a boolean. The implementation[2]
actually supports either a bool or a str (or any "truthy") value.

1. https://docs.python.org/3/library/tkinter.html#bindings-and-events
2. https://github.com/python/cpython/blob/32959108f9c543e3cb9f2b68bbc782bddded6f42/Lib/tkinter/__init__.py#L1372

Fixes #6332
@JohnVillalovos
Copy link
Contributor Author

Never mind. I see #6334 has already been proposed.

@github-actions
Copy link
Contributor

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

@sobolevn
Copy link
Member

@JohnVillalovos sorry for stealing your issue 🙂
Please, take a look at my PR. I will appreciate your feedback!

@JohnVillalovos
Copy link
Contributor Author

@JohnVillalovos sorry for stealing your issue 🙂 Please, take a look at my PR. I will appreciate your feedback!

No worries. Actually thank you for doing it! Much appreciated 👍😊

@JohnVillalovos
Copy link
Contributor Author

I guess I should actually say спасибо @sobolevn 😊

@sobolevn
Copy link
Member

Oh wow! Do you happen to know Russian? 😮 😊

@JohnVillalovos
Copy link
Contributor Author

Oh wow! Do you happen to know Russian? 😮 😊

Only a little. (my-lin-kee ???) 😟 My wife is Russian 👍 So privyet Nikita!

@sobolevn
Copy link
Member

Awesome! Great coincidence 👋

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.

tkinter: bind() method type-hint incorrectly has 'add' argument as a bool

2 participants