[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
================
@@ -567,7 +559,7 @@ def __init__(self, range, value):
self.value = value
def __repr__(self):
- return "<FixIt range %r, value %r>" % (self.range, self.value)
+ return f"<FixIt range {self.range!r}, value {self.value!r}>"
----------------
Endilll wrote:
It took me a while to find in the Python docs what `!r` does, and I find it a bit too clever. If we want `repr()` here, we should spell it.
When I was searching for uses of `__repr__` while reviewing other PRs, I definitely missed those
https://github.com/llvm/llvm-project/pull/173861
More information about the cfe-commits
mailing list