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")
| 80 | |
| 81 | @lru_cache(4096) |
| 82 | def 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 | |
| 98 | def cell_len(text: str, unicode_version: str = "auto") -> int: |