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

Materialize default values based on all the parameters available #798

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Jul 25, 2023

Fixes #760

#760 identified that this regression happened in #424. More precisely I've found out it was due to this change https://github.com/holoviz/param/pull/424/files#diff-c8fc4fb68012b66fbf42ad9e0b4714fd96a3a72b83558bc543130d78bd622eb3R1275-R1279 by which Param would "instantiate" (i.e. materialize a default Parameter value into an instance) the wrong Parameter default. That happened if a Parameter is inherited and isn't re-declared by the subclass, in which case the "instantiated" value would be the one from the first class above in the hierarchy that declares the Parameter.

Instead of the custom class hierarchy traversal I've opted for leveraging .param.objects(instance=False).

@maximlt maximlt requested a review from philippjfr July 25, 2023 23:43
Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

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

Looks good!

@maximlt maximlt merged commit a0ea10b into main Jul 26, 2023
10 checks passed
@maximlt maximlt deleted the fix_materialize_inheritance branch July 26, 2023 19:59
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.

Subclassing a Parameterized class and changing the class parameters of list / dict does not work
2 participants