MCPcopy Index your code
hub / github.com/RustPython/RustPython / count

Method count

Lib/tkinter/__init__.py:3789–3817  ·  view source on GitHub ↗

Counts the number of relevant things between the two indices. If INDEX1 is after INDEX2, the result will be a negative number (and this holds for each of the possible options). The actual items which are counted depends on the options given. The result is a tuple of

(self, index1, index2, *options, return_ints=False)

Source from the content-addressed store, hash-verified

3787 self._w, 'compare', index1, op, index2))
3788
3789 def count(self, index1, index2, *options, return_ints=False): # new in Tk 8.5
3790 """Counts the number of relevant things between the two indices.
3791
3792 If INDEX1 is after INDEX2, the result will be a negative number
3793 (and this holds for each of the possible options).
3794
3795 The actual items which are counted depends on the options given.
3796 The result is a tuple of integers, one for the result of each
3797 counting option given, if more than one option is specified or
3798 return_ints is false (default), otherwise it is an integer.
3799 Valid counting options are "chars", "displaychars",
3800 "displayindices", "displaylines", "indices", "lines", "xpixels"
3801 and "ypixels". The default value, if no option is specified, is
3802 "indices". There is an additional possible option "update",
3803 which if given then all subsequent options ensure that any
3804 possible out of date information is recalculated.
3805 """
3806 options = ['-%s' % arg for arg in options]
3807 res = self.tk.call(self._w, 'count', *options, index1, index2)
3808 if not isinstance(res, int):
3809 res = self._getints(res)
3810 if len(res) == 1:
3811 res, = res
3812 if not return_ints:
3813 if not res:
3814 res = None
3815 elif len(options) <= 1:
3816 res = (res,)
3817 return res
3818
3819 def debug(self, boolean=None):
3820 """Turn on the internal consistency checks of the B-Tree inside the text

Callers 15

format_stringFunction · 0.45
determine_parentMethod · 0.45
_dnsname_matchFunction · 0.45
_signature_from_callableFunction · 0.45
parseMethod · 0.45
_do_a_fancy_diffMethod · 0.45
__init__Method · 0.45
decodeMethod · 0.45
frombufMethod · 0.45
finalizeClass · 0.45
_guess_delimiterMethod · 0.45
_split_lineMethod · 0.45

Calls 4

isinstanceFunction · 0.85
lenFunction · 0.85
_getintsMethod · 0.80
callMethod · 0.45

Tested by 15

parseMethod · 0.36
_do_a_fancy_diffMethod · 0.36
test_null_terminatorMethod · 0.36
test_reentrancyMethod · 0.36
test_countMethod · 0.36