Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedFeb 5, 2024
edited by bedevere-appbot
Loading

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-storchakaserhiy-storchaka changed the titlegh-98484: Partially restore the behavior of tkinter.Text.count() by defaultgh-97928: Partially restore the behavior of tkinter.Text.count() by defaultFeb 5, 2024
@serhiy-storchakaserhiy-storchakaforce-pushed thetkinter-text-count-return_ints branch from9f6e1db to26aea45CompareFebruary 5, 2024 17:00
…) 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.
@serhiy-storchakaserhiy-storchakaforce-pushed thetkinter-text-count-return_ints branch from26aea45 toe44adecCompareFebruary 5, 2024 17:01
Copy link
Member

@terryjreedyterryjreedy left a comment
edited
Loading

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.

@serhiy-storchakaserhiy-storchaka merged commitd2c4baa intopython:mainFeb 11, 2024
@serhiy-storchakaserhiy-storchaka deleted the tkinter-text-count-return_ints branchFebruary 11, 2024 10:43
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull requestFeb 14, 2024
…) 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.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@terryjreedyterryjreedyterryjreedy left review comments

@gpsheadgpsheadAwaiting requested review from gpshead

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@serhiy-storchaka@terryjreedy

[8]ページ先頭

©2009-2025 Movatter.jp