MCPcopy Index your code
hub / github.com/python/cpython / count

Method count

Lib/tkinter/__init__.py:3871–3899  ·  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

3869 self._w, 'compare', index1, op, index2))
3870
3871 def count(self, index1, index2, *options, return_ints=False): # new in Tk 8.5
3872 """Counts the number of relevant things between the two indices.
3873
3874 If INDEX1 is after INDEX2, the result will be a negative number
3875 (and this holds for each of the possible options).
3876
3877 The actual items which are counted depends on the options given.
3878 The result is a tuple of integers, one for the result of each
3879 counting option given, if more than one option is specified or
3880 return_ints is false (default), otherwise it is an integer.
3881 Valid counting options are "chars", "displaychars",
3882 "displayindices", "displaylines", "indices", "lines", "xpixels"
3883 and "ypixels". The default value, if no option is specified, is
3884 "indices". There is an additional possible option "update",
3885 which if given then all subsequent options ensure that any
3886 possible out of date information is recalculated.
3887 """
3888 options = ['-%s' % arg for arg in options]
3889 res = self.tk.call(self._w, 'count', *options, index1, index2)
3890 if not isinstance(res, int):
3891 res = self._getints(res)
3892 if len(res) == 1:
3893 res, = res
3894 if not return_ints:
3895 if not res:
3896 res = None
3897 elif len(options) <= 1:
3898 res = (res,)
3899 return res
3900
3901 def debug(self, boolean=None):
3902 """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
nr_of_itemsMethod · 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

Calls 2

_getintsMethod · 0.80
callMethod · 0.45

Tested by 2

parseMethod · 0.36
_do_a_fancy_diffMethod · 0.36