[clang] [clang][Python] Use fstrings instead of string concatenations (PR #173861)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 29 07:55:38 PST 2025


================
@@ -3060,15 +3048,15 @@ def __str__(self) -> str:
             return self.name
 
         def __repr__(self) -> str:
-            return "<ChunkKind: %s>" % self
+            return f"<ChunkKind: {self}>"
 
     def __init__(self, completionString: CObjP, key: int):
         self.cs = completionString
         self.key = key
         self.__kindNumberCache = -1
 
     def __repr__(self) -> str:
-        return "{'" + self.spelling + "', " + str(self.kind) + "}"
+        return f"{{'{self.spelling}', {self.kind}}}"
----------------
Endilll wrote:

Where the second pair of curly braces came from?

https://github.com/llvm/llvm-project/pull/173861


More information about the cfe-commits mailing list