Skip to content

Improve and fix repr methods #2555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Apr 8, 2025

The following from the change entry:

  • Added missing quotes and closing parenthesis to win32com.client.build.MapEntry's repr
  • The following classes will now use the correct subclass name in repr:
    • win32rcparser.StringDef
    • win32pdhquery.QueryError
    • pywin.tools.browser.HLIPythonObject
    • win32comext.axscript.client.pyscript.NamedScriptAttribute
    • win32comext.axscript.client.error.AXScriptException
    • win32comext.axdebug.debugger.ModuleTreeNode
    • win32com.server.exception.COMException
    • win32com.client.VARIANT
  • The following classes now produce a valid eval string representation when calling repr:
    • pywin.tools.browser.HLIPythonObject
    • win32comext.axscript.client.pyscript.NamedScriptAttribute
    • win32comext.axscript.client.error.AXScriptException
    • win32com.server.exception.COMException

As well as using f-string in repr

@Avasam Avasam force-pushed the Improve-and-fix-repr-methods branch from 433abb6 to 4ae5fba Compare April 8, 2025 03:12
Copy link
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split this into 2 so it's clear what is being fixed vs what is being improved. The changelog should only list things which would be observable (ie, where the repr output changes). Type annotations for repr also seem pointless to me.

@Avasam Avasam closed this Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants