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

Function _n_items

Lib/doctest.py:1708–1714  ·  view source on GitHub ↗

Helper to pluralise the number of items in a list.

(items: list | dict)

Source from the content-addressed store, hash-verified

1706
1707
1708def _n_items(items: list | dict) -> str:
1709 """
1710 Helper to pluralise the number of items in a list.
1711 """
1712 n = len(items)
1713 s = "" if n == 1 else "s"
1714 return f"{n} item{s}"
1715
1716
1717class OutputChecker:

Callers 1

summarizeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…