diff --git a/CHANGES.md b/CHANGES.md index 29eb008c7..2befbc796 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,8 @@ As of build 305, installation .exe files have been deprecated; see Coming in build 312, as yet unreleased -------------------------------------- +* Added missing quotes and closing parenthesis to `win32com.client.build.MapEntry`'s `repr` (mhammond#2572, [@Avasam][Avasam]) + Build 311, released 2025/07/14 ------------------------------ diff --git a/com/win32com/client/build.py b/com/win32com/client/build.py index b4c5e7569..17d3ecb3d 100644 --- a/com/win32com/client/build.py +++ b/com/win32com/client/build.py @@ -70,7 +70,7 @@ class NotSupportedException(Exception): class MapEntry: - "Simple holder for named attibutes - items in a map." + """Simple holder for named attributes - items in a map.""" def __init__( self, @@ -92,17 +92,16 @@ def __init__( self.doc = doc self.resultCLSID = resultCLSID self.resultDocumentation = resultDoc - self.wasProperty = ( - 0 # Have I been transformed into a function so I can pass args? - ) + self.wasProperty = 0 + """Has this MapEntry been transformed into a function so it can pass args?""" self.hidden = hidden def __repr__(self): return ( - "MapEntry(dispid={s.dispid}, desc={s.desc}, names={s.names}, doc={s.doc!r}, " - "resultCLSID={s.resultCLSID}, resultDocumentation={s.resultDocumentation}, " - "wasProperty={s.wasProperty}, hidden={s.hidden}" - ).format(s=self) + "MapEntry(" + + ", ".join([f"{key}={value!r}" for key, value in self.__dict__.items()]) + + ")" + ) def GetResultCLSID(self): rc = self.resultCLSID