Commit e44adec
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 b4ba0f7 commit e44adec
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 | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
433 | 439 | | |
434 | 440 | | |
435 | 441 | | |
| |||
1247 | 1253 | | |
1248 | 1254 | | |
1249 | 1255 | | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | 1256 | | |
1258 | 1257 | | |
1259 | 1258 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
3745 | 3745 | | |
3746 | 3746 | | |
3747 | 3747 | | |
3748 | | - | |
| 3748 | + | |
3749 | 3749 | | |
3750 | 3750 | | |
3751 | 3751 | | |
3752 | 3752 | | |
3753 | 3753 | | |
3754 | 3754 | | |
3755 | 3755 | | |
3756 | | - | |
3757 | | - | |
3758 | | - | |
3759 | | - | |
3760 | | - | |
3761 | | - | |
3762 | | - | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
3763 | 3765 | | |
3764 | 3766 | | |
3765 | 3767 | | |
3766 | 3768 | | |
3767 | 3769 | | |
3768 | 3770 | | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
3769 | 3776 | | |
3770 | 3777 | | |
3771 | 3778 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments