From d1da9b97b5f9b11ffb041e304f628f9d1e8e476a Mon Sep 17 00:00:00 2001 From: felix-hilden Date: Tue, 1 Jun 2021 18:55:13 +0300 Subject: [PATCH] Add comment about prefix count --- src/black/strings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/black/strings.py b/src/black/strings.py index 7fc3041fd7d..9d0e2eb8430 100644 --- a/src/black/strings.py +++ b/src/black/strings.py @@ -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)}"