@@ -3025,27 +3025,133 @@ class Text(Widget, XView, YView):
3025
3025
config = configure
3026
3026
def bbox (self , index : _TextIndex ) -> tuple [int , int , int , int ] | None : ... # type: ignore[override]
3027
3027
def compare (self , index1 : _TextIndex , op : Literal ["<" , "<=" , "==" , ">=" , ">" , "!=" ], index2 : _TextIndex ) -> bool : ...
3028
- @overload
3029
- def count (self , index1 : _TextIndex , index2 : _TextIndex ) -> tuple [int ] | None : ...
3030
- @overload
3031
- def count (self , index1 : _TextIndex , index2 : _TextIndex , arg : _WhatToCount | Literal ["update" ], / ) -> tuple [int ] | None : ...
3032
- @overload
3033
- def count (self , index1 : _TextIndex , index2 : _TextIndex , arg1 : Literal ["update" ], arg2 : _WhatToCount , / ) -> int | None : ...
3034
- @overload
3035
- def count (self , index1 : _TextIndex , index2 : _TextIndex , arg1 : _WhatToCount , arg2 : Literal ["update" ], / ) -> int | None : ...
3036
- @overload
3037
- def count (self , index1 : _TextIndex , index2 : _TextIndex , arg1 : _WhatToCount , arg2 : _WhatToCount , / ) -> tuple [int , int ]: ...
3038
- @overload
3039
- def count (
3040
- self ,
3041
- index1 : _TextIndex ,
3042
- index2 : _TextIndex ,
3043
- arg1 : _WhatToCount | Literal ["update" ],
3044
- arg2 : _WhatToCount | Literal ["update" ],
3045
- arg3 : _WhatToCount | Literal ["update" ],
3046
- / ,
3047
- * args : _WhatToCount | Literal ["update" ],
3048
- ) -> tuple [int , ...]: ...
3028
+ if sys .version_info >= (3 , 13 ):
3029
+ @overload
3030
+ def count (self , index1 : _TextIndex , index2 : _TextIndex , * , return_ints : Literal [True ]) -> int : ...
3031
+ @overload
3032
+ def count (
3033
+ self , index1 : _TextIndex , index2 : _TextIndex , arg : _WhatToCount | Literal ["update" ], / , * , return_ints : Literal [True ]
3034
+ ) -> int : ...
3035
+ @overload
3036
+ def count (
3037
+ self ,
3038
+ index1 : _TextIndex ,
3039
+ index2 : _TextIndex ,
3040
+ arg1 : Literal ["update" ],
3041
+ arg2 : _WhatToCount ,
3042
+ / ,
3043
+ * ,
3044
+ return_ints : Literal [True ],
3045
+ ) -> int : ...
3046
+ @overload
3047
+ def count (
3048
+ self ,
3049
+ index1 : _TextIndex ,
3050
+ index2 : _TextIndex ,
3051
+ arg1 : _WhatToCount ,
3052
+ arg2 : Literal ["update" ],
3053
+ / ,
3054
+ * ,
3055
+ return_ints : Literal [True ],
3056
+ ) -> int : ...
3057
+ @overload
3058
+ def count (
3059
+ self , index1 : _TextIndex , index2 : _TextIndex , arg1 : _WhatToCount , arg2 : _WhatToCount , / , * , return_ints : Literal [True ]
3060
+ ) -> tuple [int , int ]: ...
3061
+ @overload
3062
+ def count (
3063
+ self ,
3064
+ index1 : _TextIndex ,
3065
+ index2 : _TextIndex ,
3066
+ arg1 : _WhatToCount | Literal ["update" ],
3067
+ arg2 : _WhatToCount | Literal ["update" ],
3068
+ arg3 : _WhatToCount | Literal ["update" ],
3069
+ / ,
3070
+ * args : _WhatToCount | Literal ["update" ],
3071
+ return_ints : Literal [True ],
3072
+ ) -> tuple [int , ...]: ...
3073
+ @overload
3074
+ def count (self , index1 : _TextIndex , index2 : _TextIndex , * , return_ints : Literal [False ] = False ) -> tuple [int ] | None : ...
3075
+ @overload
3076
+ def count (
3077
+ self ,
3078
+ index1 : _TextIndex ,
3079
+ index2 : _TextIndex ,
3080
+ arg : _WhatToCount | Literal ["update" ],
3081
+ / ,
3082
+ * ,
3083
+ return_ints : Literal [False ] = False ,
3084
+ ) -> tuple [int ] | None : ...
3085
+ @overload
3086
+ def count (
3087
+ self ,
3088
+ index1 : _TextIndex ,
3089
+ index2 : _TextIndex ,
3090
+ arg1 : Literal ["update" ],
3091
+ arg2 : _WhatToCount ,
3092
+ / ,
3093
+ * ,
3094
+ return_ints : Literal [False ] = False ,
3095
+ ) -> int | None : ...
3096
+ @overload
3097
+ def count (
3098
+ self ,
3099
+ index1 : _TextIndex ,
3100
+ index2 : _TextIndex ,
3101
+ arg1 : _WhatToCount ,
3102
+ arg2 : Literal ["update" ],
3103
+ / ,
3104
+ * ,
3105
+ return_ints : Literal [False ] = False ,
3106
+ ) -> int | None : ...
3107
+ @overload
3108
+ def count (
3109
+ self ,
3110
+ index1 : _TextIndex ,
3111
+ index2 : _TextIndex ,
3112
+ arg1 : _WhatToCount ,
3113
+ arg2 : _WhatToCount ,
3114
+ / ,
3115
+ * ,
3116
+ return_ints : Literal [False ] = False ,
3117
+ ) -> tuple [int , int ]: ...
3118
+ @overload
3119
+ def count (
3120
+ self ,
3121
+ index1 : _TextIndex ,
3122
+ index2 : _TextIndex ,
3123
+ arg1 : _WhatToCount | Literal ["update" ],
3124
+ arg2 : _WhatToCount | Literal ["update" ],
3125
+ arg3 : _WhatToCount | Literal ["update" ],
3126
+ / ,
3127
+ * args : _WhatToCount | Literal ["update" ],
3128
+ return_ints : Literal [False ] = False ,
3129
+ ) -> tuple [int , ...]: ...
3130
+ else :
3131
+ @overload
3132
+ def count (self , index1 : _TextIndex , index2 : _TextIndex ) -> tuple [int ] | None : ...
3133
+ @overload
3134
+ def count (
3135
+ self , index1 : _TextIndex , index2 : _TextIndex , arg : _WhatToCount | Literal ["update" ], /
3136
+ ) -> tuple [int ] | None : ...
3137
+ @overload
3138
+ def count (self , index1 : _TextIndex , index2 : _TextIndex , arg1 : Literal ["update" ], arg2 : _WhatToCount , / ) -> int | None : ...
3139
+ @overload
3140
+ def count (self , index1 : _TextIndex , index2 : _TextIndex , arg1 : _WhatToCount , arg2 : Literal ["update" ], / ) -> int | None : ...
3141
+ @overload
3142
+ def count (self , index1 : _TextIndex , index2 : _TextIndex , arg1 : _WhatToCount , arg2 : _WhatToCount , / ) -> tuple [int , int ]: ...
3143
+ @overload
3144
+ def count (
3145
+ self ,
3146
+ index1 : _TextIndex ,
3147
+ index2 : _TextIndex ,
3148
+ arg1 : _WhatToCount | Literal ["update" ],
3149
+ arg2 : _WhatToCount | Literal ["update" ],
3150
+ arg3 : _WhatToCount | Literal ["update" ],
3151
+ / ,
3152
+ * args : _WhatToCount | Literal ["update" ],
3153
+ ) -> tuple [int , ...]: ...
3154
+
3049
3155
@overload
3050
3156
def debug (self , boolean : None = None ) -> bool : ...
3051
3157
@overload
0 commit comments