MCPcopy
hub / github.com/Textualize/rich / cached_cell_len

Function cached_cell_len

rich/cells.py:82–95  ·  view source on GitHub ↗

Get the number of cells required to display text. This method always caches, which may use up a lot of memory. It is recommended to use `cell_len` over this method. Args: text (str): Text to display. unicode_version: Unicode version, `"auto"` to auto detect, `"latest"`

(text: str, unicode_version: str = "auto")

Source from the content-addressed store, hash-verified

80
81@lru_cache(4096)
82def cached_cell_len(text: str, unicode_version: str = "auto") -> int:
83 """Get the number of cells required to display text.
84
85 This method always caches, which may use up a lot of memory. It is recommended to use
86 `cell_len` over this method.
87
88 Args:
89 text (str): Text to display.
90 unicode_version: Unicode version, `"auto"` to auto detect, `"latest"` for the latest unicode version.
91
92 Returns:
93 int: Get the number of cells required to display text.
94 """
95 return _cell_len(text, unicode_version)
96
97
98def cell_len(text: str, unicode_version: str = "auto") -> int:

Callers 1

cell_lenFunction · 0.85

Calls 1

_cell_lenFunction · 0.85

Tested by

no test coverage detected