Skip to content

Commit 92b5303

Browse files
committed
Define _StrPath.__radd__()
1 parent 5739a9d commit 92b5303

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sphinx/util/_pathlib.py

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def __add__(self, other: str) -> str:
5757
warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
5858
return self.__str__() + other
5959

60+
def __radd__(self, other: str) -> str:
61+
warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
62+
return other + self.__str__()
63+
6064
def __bool__(self) -> bool:
6165
if not self.__str__():
6266
warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
@@ -108,6 +112,10 @@ def __add__(self, other: str) -> str:
108112
warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
109113
return self.__str__() + other
110114

115+
def __radd__(self, other: str) -> str:
116+
warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
117+
return other + self.__str__()
118+
111119
def __bool__(self) -> bool:
112120
if not self.__str__():
113121
warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)

0 commit comments

Comments
 (0)