MCPcopy
hub / github.com/sphinx-doc/sphinx / replace

Method replace

sphinx/util/_pathlib.py:41–47  ·  view source on GitHub ↗
(  # type: ignore[override]
            self, old: str, new: str, count: int = -1, /
        )

Source from the content-addressed store, hash-verified

39
40 class _StrPath(WindowsPath):
41 def replace( # type: ignore[override]
42 self, old: str, new: str, count: int = -1, /
43 ) -> str:
44 # replace exists in both Path and str;
45 # in Path it makes filesystem changes, so we use the safer str version
46 warnings.warn(_MSG, RemovedInSphinx10Warning, stacklevel=2)
47 return self.__str__().replace(old, new, count) # NoQA: PLC2801
48
49 def __getattr__(self, item: str) -> Any:
50 if item in _STR_METHODS:

Callers 15

runMethod · 0.80
runMethod · 0.80
_migrate_conf_to_tomlFunction · 0.80
filter_whitespaceFunction · 0.80
escapeMethod · 0.80
sphinx_smarty_pantsFunction · 0.80
fix_fragmentMethod · 0.80
build_contentMethod · 0.80
write_documentsMethod · 0.80
hlMethod · 0.80

Calls 2

warnMethod · 0.80
__str__Method · 0.45