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

Group inherited methods for objects in the variables pane #4351

Open
seeM opened this issue Aug 14, 2024 · 0 comments
Open

Group inherited methods for objects in the variables pane #4351

seeM opened this issue Aug 14, 2024 · 0 comments
Labels
area: variables Issues related to Variables category. enhancement New feature or request support
Milestone

Comments

@seeM
Copy link
Contributor

seeM commented Aug 14, 2024

This is a bit hard to describe, and I'm not sure how I'd accomplish it but here goes.

When viewing objects in the object viewer Positron very helpfully displays all of the methods attached to that object. The issue is that when an object inherits from something like a pandas Series, all of the methods are mixed together. It would be better if direct and inherited methods were differentiated in the tree structure.

For example consider in this class I want my_method to be at the top with all of the pandas methods hidden in a drop down. I could also see a similar UI being really handy for S4 classes because it would maybe be easier to keep track of multiple inheritance.

import pandas as pd

class CustomSeries(pd.Series):
    @property
    def _constructor(self):
        return CustomSeries
    
    def my_method(self):
        return self ** 2

# Example usage
data = [1, 2, 3, 4, 5]
custom_series = CustomSeries(data)

Originally posted by @gshotwell in #4332

@seeM seeM added enhancement New feature or request area: variables Issues related to Variables category. labels Aug 14, 2024
@juliasilge juliasilge added this to the Future milestone Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: variables Issues related to Variables category. enhancement New feature or request support
Projects
None yet
Development

No branches or pull requests

2 participants