Skip to content
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

[release-1.10] Backport fix for show on MethodList when methods are from another module #52617

Closed
wants to merge 1 commit into from

Conversation

ararslan
Copy link
Member

This is a backport of #52354 directly to the release-1.10 branch.

)

When a type is defined in one module but its methods are defined
elsewhere, `show_method_table` errors due to an incorrect lookup of the
defining module used to determine colors for printing. In particular,
the code had been assuming that the type is defined in the module in
which its constructor's first method (in the sense of
`first(methods())`) is defined, which isn't always true.

The color used for printing the module name needs to be determined on a
per-method basis and can't be correctly done based on the method table's
module. For each method, we attempt to derive the module for the method
table to which the method was added, then determine whether it's the
same as the defining module for the method.

Fixes #49382
Fixes #49403
Fixes #52043

Co-Authored-By: Jameson Nash <[email protected]>
(cherry picked from commit 40bc64c)
@ararslan ararslan added kind:bugfix This change fixes an existing bug domain:display and printing Aesthetics and correctness of printed representations of objects. labels Dec 22, 2023
@KristofferC
Copy link
Sponsor Member

KristofferC commented Dec 23, 2023

Put into #52622

@ararslan ararslan deleted the aa/backport-52354 branch January 5, 2024 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects. kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants