MCPcopy
hub / github.com/tornadoweb/tornado / list

Method list

tornado/locale.py:456–471  ·  view source on GitHub ↗

Returns a comma-separated list for the given list of parts. The format is, e.g., "A, B and C", "A and B" or just "A" for lists of size 1.

(self, parts: Any)

Source from the content-addressed store, hash-verified

454 }
455
456 def list(self, parts: Any) -> str:
457 """Returns a comma-separated list for the given list of parts.
458
459 The format is, e.g., "A, B and C", "A and B" or just "A" for lists
460 of size 1.
461 """
462 _ = self.translate
463 if len(parts) == 0:
464 return ""
465 if len(parts) == 1:
466 return parts[0]
467 comma = " \u0648 " if self.code.startswith("fa") else ", "
468 return _("%(commas)s and %(last)s") % {
469 "commas": comma.join(parts[:-1]),
470 "last": parts[len(parts) - 1],
471 }
472
473 def friendly_number(self, value: int) -> str:
474 """Returns a comma-separated number for the given integer."""

Callers 1

test_listMethod · 0.80

Calls 2

_Function · 0.85
joinMethod · 0.80

Tested by 1

test_listMethod · 0.64