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

Show python class docstring too (when there is __init__) #7034

Closed
sglbl opened this issue Mar 8, 2025 · 1 comment
Closed

Show python class docstring too (when there is __init__) #7034

sglbl opened this issue Mar 8, 2025 · 1 comment
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@sglbl
Copy link

sglbl commented Mar 8, 2025

When I create a class with an __init__ function (and its docstring), VSCode doesn't read the docstring of class but only the __init__.

class Toto:
    """ The Toto class and details """

    class_attribute: str = ""
    """class_attribute (str): (class attribute) The class attribute"""

    def __init__(self):
        """ This is the constructor
    
        Attributes:
            instance_attribute (str): The instance attribute
        """
        self.instance_attribute: str = ""
        
obj = Toto()

Example:
Image
I already opened an issue in vscode issues and I was redirected here. microsoft/vscode#242892
I want to show show python class docstring with __init__ docstring together. It doesn't make sense that class docstring is not shown anymore.

@karthiknadig karthiknadig transferred this issue from microsoft/vscode-python Mar 10, 2025
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Mar 10, 2025
@StellaHuang95
Copy link
Contributor

This is a duplicate of this issue. Please refer to the link for an explanation of why this is by design. We're happy to revisit it if we receive more user feedback requesting a change in behavior. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants