FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-97928: Partially restore the behavior of tkinter.Text.count() by default by serhiy-storchaka · Pull Request #115031 · python/cpython · GitHub

/ cpython Public

gh-97928: Partially restore the behavior of tkinter.Text.count() by default - #115031

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:tkinter-text-count-return_ints
Feb 11, 2024
Merged

gh-97928: Partially restore the behavior of tkinter.Text.count() by default#115031
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:tkinter-text-count-return_ints

Conversation

serhiy-storchaka commented Feb 5, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

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/

serhiy-storchaka changed the title gh-98484: Partially restore the behavior of tkinter.Text.count() by default gh-97928: Partially restore the behavior of tkinter.Text.count() by default Feb 5, 2024
serhiy-storchaka force-pushed the tkinter-text-count-return_ints branch from 9f6e1db to 26aea45 Compare February 5, 2024 17:00
…) by default

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'), 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 makes
Text.count() always returning the single count as an integer
insteaf of a 1-tuple or None.
serhiy-storchaka force-pushed the tkinter-text-count-return_ints branch from 26aea45 to e44adec Compare February 5, 2024 17:01
Comment thread Doc/whatsnew/3.13.rst Outdated

terryjreedy left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks ok with an optional comment deletion and two questions. EDIT Sufficiently answered.
The added tests look correct.

Comment thread Lib/tkinter/__init__.py
Comment thread Lib/tkinter/__init__.py
serhiy-storchaka merged commit d2c4baa into python:main Feb 11, 2024
serhiy-storchaka deleted the tkinter-text-count-return_ints branch February 11, 2024 10:43
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
…) by default (pythonGH-115031)

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'), 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 makes
Text.count() always returning the single count as an integer
instead of a 1-tuple or None.
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL