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

Function _n_items

Lib/doctest.py:1681–1687  ·  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

1679
1680
1681def _n_items(items: list | dict) -> str:
1682 """
1683 Helper to pluralise the number of items in a list.
1684 """
1685 n = len(items)
1686 s = "" if n == 1 else "s"
1687 return f"{n} item{s}"
1688
1689
1690class OutputChecker:

Callers 1

summarizeMethod · 0.85

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected