Commit 26aea45
committed
gh-97928: Partially restore the behavior of tkinter.Text.count() 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.1 parent 87cd20a commit 26aea45
File tree
5 files changed
+59
-28
lines changed- Doc/whatsnew
- Lib
- idlelib
- test/test_tkinter
- tkinter
- Misc/NEWS.d/next/Library
5 files changed
+59
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
424 | 430 | | |
425 | 431 | | |
426 | 432 | | |
| |||
1238 | 1244 | | |
1239 | 1245 | | |
1240 | 1246 | | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | 1247 | | |
1249 | 1248 | | |
1250 | 1249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | | - | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
58 | 62 | | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
66 | 79 | | |
67 | 80 | | |
68 | 81 | | |
69 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
70 | 85 | | |
71 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
72 | 89 | | |
73 | | - | |
74 | | - | |
75 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
76 | 96 | | |
77 | 97 | | |
78 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3732 | 3732 | | |
3733 | 3733 | | |
3734 | 3734 | | |
3735 | | - | |
| 3735 | + | |
3736 | 3736 | | |
3737 | 3737 | | |
3738 | 3738 | | |
3739 | 3739 | | |
3740 | 3740 | | |
3741 | 3741 | | |
3742 | 3742 | | |
3743 | | - | |
3744 | | - | |
3745 | | - | |
3746 | | - | |
3747 | | - | |
3748 | | - | |
3749 | | - | |
| 3743 | + | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
3750 | 3752 | | |
3751 | 3753 | | |
3752 | 3754 | | |
3753 | 3755 | | |
3754 | 3756 | | |
3755 | 3757 | | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
3756 | 3763 | | |
3757 | 3764 | | |
3758 | 3765 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments