@@ -890,21 +890,13 @@ impl PyStr {
890890 )
891891 }
892892
893- /// Return a str with the given prefix string removed if present.
894- ///
895- /// If the string starts with the prefix string, return string[len(prefix):]
896- /// Otherwise, return a copy of the original string.
897893 #[pymethod]
898894 fn removeprefix(&self, pref: PyStrRef) -> Wtf8Buf {
899895 self.as_wtf8()
900896 .py_removeprefix(pref.as_wtf8(), pref.byte_len(), |s, p| s.starts_with(p))
901897 .to_owned()
902898 }
903899
904- /// Return a str with the given suffix string removed if present.
905- ///
906- /// If the string ends with the suffix string, return string[:len(suffix)]
907- /// Otherwise, return a copy of the original string.
908900 #[pymethod]
909901 fn removesuffix(&self, suffix: PyStrRef) -> Wtf8Buf {
910902 self.as_wtf8()
@@ -955,10 +947,6 @@ impl PyStr {
955947 format(&format_str, &args, vm)
956948 }
957949
958- /// S.format_map(mapping) -> str
959- ///
960- /// Return a formatted version of S, using substitutions from mapping.
961- /// The substitutions are identified by braces ('{' and '}').
962950 #[pymethod]
963951 fn format_map(&self, mapping: PyObjectRef, vm: &VirtualMachine) -> PyResult<Wtf8Buf> {
964952 let format_string =
@@ -989,8 +977,6 @@ impl PyStr {
989977 Ok(vm.ctx.new_str(s))
990978 }
991979
992- /// Return a titlecased version of the string where words start with an
993- /// uppercase character and the remaining characters are lowercase.
994980 #[pymethod]
995981 fn title(&self) -> Wtf8Buf {
996982 let mut title = Wtf8Buf::with_capacity(self.data.len());
@@ -1066,21 +1052,6 @@ impl PyStr {
10661052 }
10671053 }
10681054
1069- /// Return true if all characters in the string are printable or the string is empty,
1070- /// false otherwise. Nonprintable characters are those characters defined in the
1071- /// Unicode character database as `Other` or `Separator`,
1072- /// excepting the ASCII space (0x20) which is considered printable.
1073- ///
1074- /// All characters except those characters defined in the Unicode character
1075- /// database as following categories are considered printable.
1076- /// * Cc (Other, Control)
1077- /// * Cf (Other, Format)
1078- /// * Cs (Other, Surrogate)
1079- /// * Co (Other, Private Use)
1080- /// * Cn (Other, Not Assigned)
1081- /// * Zl Separator, Line ('\u2028', LINE SEPARATOR)
1082- /// * Zp Separator, Paragraph ('\u2029', PARAGRAPH SEPARATOR)
1083- /// * Zs (Separator, Space) other than ASCII space('\x20').
10841055 #[pymethod]
10851056 fn isprintable(&self) -> bool {
10861057 self.char_all(|c| c == '\u{0020}' || rustpython_literal::char::is_printable(c))
@@ -1246,8 +1217,6 @@ impl PyStr {
12461217 .to_pyobject(vm))
12471218 }
12481219
1249- /// Return `true` if the sequence is ASCII titlecase and the sequence is not
1250- /// empty, `false` otherwise.
12511220 #[pymethod]
12521221 fn istitle(&self) -> bool {
12531222 if self.data.is_empty() {
0 commit comments