---
source: crates/ruff_linter/src/rules/pydocstyle/mod.rs
---
D301 [*] Use `r"""` if any backslashes in a docstring
 --> D301.py:2:5
  |
1 | def double_quotes_backslash():
2 |     """Sum\\mary."""
  |     ^^^^^^^^^^^^^^^^
  |
help: Add `r` prefix
  |
1 | def double_quotes_backslash():
  -     """Sum\\mary."""
2 +     r"""Sum\\mary."""
3 |
  |
note: This is an unsafe fix and may change runtime behavior

D301 Use `r"""` if any backslashes in a docstring
  --> D301.py:37:5
   |
36 | def shouldnt_add_raw_here2():
37 |     u"Sum\\mary."
   |     ^^^^^^^^^^^^^
   |
help: Add `r` prefix

D301 [*] Use `r"""` if any backslashes in a docstring
  --> D301.py:93:5
   |
92 |   def should_add_raw_for_single_double_quote_escape():
93 | /     """
94 | |     This is single quote escape \".
95 | |     """
   | |_______^
   |
help: Add `r` prefix
   |
92 | def should_add_raw_for_single_double_quote_escape():
   -     """
93 +     r"""
94 |     This is single quote escape \".
   |
note: This is an unsafe fix and may change runtime behavior

D301 [*] Use `r"""` if any backslashes in a docstring
   --> D301.py:99:5
    |
 98 |   def should_add_raw_for_single_single_quote_escape():
 99 | /     '''
100 | |     This is single quote escape \'.
101 | |     '''
    | |_______^
    |
help: Add `r` prefix
    |
98  | def should_add_raw_for_single_single_quote_escape():
    -     '''
99  +     r'''
100 |     This is single quote escape \'.
    |
note: This is an unsafe fix and may change runtime behavior
