Skip to content

Commit

Permalink
Add comment about prefix count
Browse files Browse the repository at this point in the history
  • Loading branch information
felix-hilden committed Jan 13, 2022
1 parent d7b0a5f commit d1da9b9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/black/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def normalize_string_prefix(s: str) -> str:
.replace("u", "")
)

# Python syntax guarantees max 2 prefixes and that one of them is "r"
if len(new_prefix) == 2 and "r" != new_prefix[0].lower():
new_prefix = new_prefix[::-1]
return f"{new_prefix}{match.group(2)}"
Expand Down

0 comments on commit d1da9b9

Please sign in to comment.