From a6f262fc741a59f4e16448f001d3e864cd8c7731 Mon Sep 17 00:00:00 2001 From: Jukka Lehtosalo Date: Wed, 12 Mar 2025 11:33:45 +0000 Subject: [PATCH] [mypyc] Document that strip() etc. are optimized (Also unrelated minor formatting tweak to frozenset docs.) --- mypyc/doc/frozenset_operations.rst | 2 +- mypyc/doc/str_operations.rst | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mypyc/doc/frozenset_operations.rst b/mypyc/doc/frozenset_operations.rst index a30b6a55c584..3d946a8fa9a3 100644 --- a/mypyc/doc/frozenset_operations.rst +++ b/mypyc/doc/frozenset_operations.rst @@ -1,7 +1,7 @@ .. _frozenset-ops: Native frozenset operations -====================== +=========================== These ``frozenset`` operations have fast, optimized implementations. Other frozenset operations use generic implementations that are often slower. diff --git a/mypyc/doc/str_operations.rst b/mypyc/doc/str_operations.rst index 5b18c0c927d6..11828a4d128a 100644 --- a/mypyc/doc/str_operations.rst +++ b/mypyc/doc/str_operations.rst @@ -37,6 +37,8 @@ Methods * ``s1.find(s2: str, start: int)`` * ``s1.find(s2: str, start: int, end: int)`` * ``s.join(x: Iterable)`` +* ``s.lstrip()`` +* ``s.lstrip(chars: str)`` * ``s.partition(sep: str)`` * ``s.removeprefix(prefix: str)`` * ``s.removesuffix(suffix: str)`` @@ -49,6 +51,8 @@ Methods * ``s.rsplit()`` * ``s.rsplit(sep: str)`` * ``s.rsplit(sep: str, maxsplit: int)`` +* ``s.rstrip()`` +* ``s.rstrip(chars: str)`` * ``s.split()`` * ``s.split(sep: str)`` * ``s.split(sep: str, maxsplit: int)`` @@ -56,6 +60,8 @@ Methods * ``s.splitlines(keepends: bool)`` * ``s1.startswith(s2: str)`` * ``s1.startswith(t: tuple[str, ...])`` +* ``s.strip()`` +* ``s.strip(chars: str)`` .. note::