Write string literal value with a best effort attempt to avoid backslashes.
(self, string, *, quote_types=_ALL_QUOTES)
| 568 | return escaped_string, possible_quotes |
| 569 | |
| 570 | def _write_str_avoiding_backslashes(self, string, *, quote_types=_ALL_QUOTES): |
| 571 | """Write string literal value with a best effort attempt to avoid backslashes.""" |
| 572 | string, quote_types = self._str_literal_helper(string, quote_types=quote_types) |
| 573 | quote_type = quote_types[0] |
| 574 | self.write(f"{quote_type}{string}{quote_type}") |
| 575 | |
| 576 | def _ftstring_helper(self, parts): |
| 577 | new_parts = [] |
no test coverage detected