( # type: ignore[override]
self, old: str, new: str, count: int = -1, /
)
| 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: |