pylint icon indicating copy to clipboard operation
pylint copied to clipboard

Add clarification of the r string modifier

Open tedsecretsource opened this issue 2 months ago • 4 comments

Raw sting literals may not be easily understood based on the brief description. This description is much more verbose (maybe too verbose) but should help the novice python programmer understand what the r modifier is and how / when to use it.

Type of Changes

Type
:scroll: Docs

Description

Added a more verbose description of the r (raw string literal) modifier for the novices like me…

tedsecretsource avatar Apr 26 '24 09:04 tedsecretsource

I like the idea, but have some suggestions how to improve it:

  • There is a bit of inconsistent spelling, sometimes it's "Python", sometimes "python" instead.
  • I understand the issue, but if I didn't I wouldn't understand the reference to regular expressions. Make that three paragraphs, one for how escape sequences in strings work, one that explains how to use either raw strings or double backslashes and the third explaining why this is particularly useful for regular expressions.
  • "and not to modify it" -> "and not to interpret backslashes as escape characters" (Python strings are immutable already)

UlrichEckhardt avatar Apr 29 '24 19:04 UlrichEckhardt