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

GridSpec objects attribute violates Panel interface contract #546

Closed
analog-cbarber opened this issue Jul 23, 2019 · 2 comments · Fixed by #743
Closed

GridSpec objects attribute violates Panel interface contract #546

analog-cbarber opened this issue Jul 23, 2019 · 2 comments · Fixed by #743
Labels
good first issue Good for newcomers type: bug Something isn't correct or isn't working
Milestone

Comments

@analog-cbarber
Copy link

The Panel class provides an objects attribute that is expected to contain a list of child objects:

class Panel(Reactive):
   ...
    objects = param.Parameter(default=[], doc="""
        The list of child objects that make up the layout.""")

but GridSpec overrides this with a dictionary:

class GridSpec(Panel):
   ...
    objects = param.Dict(default={}, doc="""
        The dictionary of child objects that make up the grid.""")

Consequently any code that is meant to operate on a Panel .object list is likely to break when applied to a GridSpec. In particular, the Panel._cleanup, which is inherited by GridSpec will fail because iterating over the objects will return tuples instead of the actual child objects.

For this case, you could probably fix this by overriding _cleanup in GridSpec but it would not fix the underlying issue.

Observed using Panel 0.6.0.

@philippjfr
Copy link
Member

Thanks, most of the code in Panel should probably just move to ListPanel.

@jsignell jsignell added good first issue Good for newcomers type: bug Something isn't correct or isn't working labels Jul 25, 2019
@jsignell jsignell added this to the v0.6.1 milestone Jul 25, 2019
@analog-cbarber
Copy link
Author

Seems like this is might not be a good first issue if it involves a significant API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants