[Python-checkins] Code beautification using f-strings (#5618)

Raymond Hettinger webhook-mailer at python.org
Sun Feb 11 11:00:14 EST 2018


https://github.com/python/cpython/commit/136c8e07955392676680c8e29ab96017127b6672
commit: 136c8e07955392676680c8e29ab96017127b6672
branch: master
author: Raymond Hettinger <rhettinger at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-02-11T08:00:11-08:00
summary:

Code beautification using f-strings (#5618)

files:
M Lib/collections/__init__.py

diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py
index 9a753db71cae..3109054e20c1 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -933,8 +933,7 @@ def __bool__(self):
 
     @_recursive_repr()
     def __repr__(self):
-        return '{0.__class__.__name__}({1})'.format(
-            self, ', '.join(map(repr, self.maps)))
+        return f'{self.__class__.__name__}({", ".join(map(repr, self.maps))})'
 
     @classmethod
     def fromkeys(cls, iterable, *args):



More information about the Python-checkins mailing list