Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-97928: Partially restore the behavior of tkinter.Text.count() by default#115031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-97928: Partially restore the behavior of tkinter.Text.count() by default#115031
Uh oh!
There was an error while loading.Please reload this page.
Conversation
9f6e1db
to26aea45
Compare…) by defaultBy default, it preserves an inconsistent behavior of older Pythonversions: packs the count into a 1-tuple if only one or noneoptions are specified (including 'update'), returns None instead of 0.Except that setting wantobjects to 0 no longer affects the result.Add a new parameter return_ints: specifying return_ints=True makesText.count() always returning the single count as an integerinsteaf of a 1-tuple or None.
26aea45
toe44adec
CompareUh oh!
There was an error while loading.Please reload this page.
terryjreedy left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks ok with an optional comment deletion and two questions. EDIT Sufficiently answered.
The added tests look correct.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…) by default (pythonGH-115031)By default, it preserves an inconsistent behavior of older Pythonversions: packs the count into a 1-tuple if only one or noneoptions are specified (including 'update'), returns None instead of 0.Except that setting wantobjects to 0 no longer affects the result.Add a new parameter return_ints: specifying return_ints=True makesText.count() always returning the single count as an integerinstead of a 1-tuple or None.
Uh oh!
There was an error while loading.Please reload this page.
By default, it preserves an inconsistent behavior of older Python versions: packs the count into a 1-tuple if only one or none options are specified (including 'update').
Except that setting wantobjects to 0 no longer affects the result.
Add a new parameter return_ints: specifying return_ints=True makes Text.count() returning the single count as an integer.
📚 Documentation preview 📚:https://cpython-previews--115031.org.readthedocs.build/