Skip to content

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
@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

3 participants