Home / Function/ removesuffix() — anthropic-sdk-python Function Reference

removesuffix() — anthropic-sdk-python Function Reference

Architecture documentation for the removesuffix() function in _utils.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  51503a31_97d0_5fd9_9605_f4a361a33456["removesuffix()"]
  c93149f4_1fef_7df2_3583_785d1eb6e828["_utils.py"]
  51503a31_97d0_5fd9_9605_f4a361a33456 -->|defined in| c93149f4_1fef_7df2_3583_785d1eb6e828
  style 51503a31_97d0_5fd9_9605_f4a361a33456 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_utils/_utils.py lines 356–363

def removesuffix(string: str, suffix: str) -> str:
    """Remove a suffix from a string.

    Backport of `str.removesuffix` for Python < 3.9
    """
    if string.endswith(suffix):
        return string[: -len(suffix)]
    return string

Subdomains

Frequently Asked Questions

What does removesuffix() do?
removesuffix() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_utils/_utils.py.
Where is removesuffix() defined?
removesuffix() is defined in src/anthropic/_utils/_utils.py at line 356.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free