Lines Matching refs:str

10         def __html__(self) -> str:
19 def _simple_escaping_wrapper(func: "t.Callable[_P, str]") -> "t.Callable[_P, Markup]":
29 class Markup(str):
56 This is a subclass of :class:`str`. It has the same methods, but
68 cls, base: t.Any = "", encoding: t.Optional[str] = None, errors: str = "strict"
81 def __add__(self, other: t.Union[str, "HasHTML"]) -> "te.Self":
82 if isinstance(other, str) or hasattr(other, "__html__"):
87 def __radd__(self, other: t.Union[str, "HasHTML"]) -> "te.Self":
88 if isinstance(other, str) or hasattr(other, "__html__"):
105 elif hasattr(type(arg), "__getitem__") and not isinstance(arg, str):
114 def __repr__(self) -> str:
117 def join(self, seq: t.Iterable[t.Union[str, "HasHTML"]]) -> "te.Self":
120 join.__doc__ = str.join.__doc__
123 self, sep: t.Optional[str] = None, maxsplit: int = -1
127 split.__doc__ = str.split.__doc__
130 self, sep: t.Optional[str] = None, maxsplit: int = -1
134 rsplit.__doc__ = str.rsplit.__doc__
141 splitlines.__doc__ = str.splitlines.__doc__
143 def unescape(self) -> str:
152 return unescape(str(self))
154 def striptags(self) -> str:
161 value = str(self)
211 __getitem__ = _simple_escaping_wrapper(str.__getitem__)
212 capitalize = _simple_escaping_wrapper(str.capitalize)
213 title = _simple_escaping_wrapper(str.title)
214 lower = _simple_escaping_wrapper(str.lower)
215 upper = _simple_escaping_wrapper(str.upper)
216 replace = _simple_escaping_wrapper(str.replace)
217 ljust = _simple_escaping_wrapper(str.ljust)
218 rjust = _simple_escaping_wrapper(str.rjust)
219 lstrip = _simple_escaping_wrapper(str.lstrip)
220 rstrip = _simple_escaping_wrapper(str.rstrip)
221 center = _simple_escaping_wrapper(str.center)
222 strip = _simple_escaping_wrapper(str.strip)
223 translate = _simple_escaping_wrapper(str.translate)
224 expandtabs = _simple_escaping_wrapper(str.expandtabs)
225 swapcase = _simple_escaping_wrapper(str.swapcase)
226 zfill = _simple_escaping_wrapper(str.zfill)
227 casefold = _simple_escaping_wrapper(str.casefold)
230 removeprefix = _simple_escaping_wrapper(str.removeprefix)
231 removesuffix = _simple_escaping_wrapper(str.removesuffix)
233 def partition(self, sep: str) -> t.Tuple["te.Self", "te.Self", "te.Self"]:
238 def rpartition(self, sep: str) -> t.Tuple["te.Self", "te.Self", "te.Self"]:
248 self, map: t.Mapping[str, t.Any]
253 def __html_format__(self, format_spec: str) -> "te.Self":
267 def format_field(self, value: t.Any, format_spec: str) -> str:
279 # We need to make sure the format spec is str here as
281 rv = string.Formatter.format_field(self, value, str(format_spec))
282 return str(self.escape(rv))
293 if isinstance(value, str) or hasattr(value, "__html__"):
311 def __str__(self) -> str:
312 return str(self.escape(self.obj))
314 def __repr__(self) -> str:
315 return str(self.escape(repr(self.obj)))