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

Hide certain implementation specific classes/variables #1684

Merged
merged 7 commits into from
Mar 10, 2021

Conversation

lzchen
Copy link
Contributor

@lzchen lzchen commented Mar 9, 2021

Fixes #1640

@lzchen lzchen requested review from a team, owais and ocelotl and removed request for a team March 9, 2021 18:54
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -30,24 +30,15 @@ class RuntimeContext(ABC):

@abstractmethod
def attach(self, context: Context) -> object:
"""Sets the current `Context` object. Returns a
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the documentation? It is very possible that this documentation applies for all implementations of this abstract method.

Also this:

from abc import ABC, abstractmethod
from inspect import getdoc


class Parent(ABC):
    @abstractmethod
    def method(self):
        """
        The documentation for method
        """


class Child(Parent):

    def method(self):
        pass


print(getdoc(Child().method))
The documentation for method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since _RuntimeContext is used internally, we do not expect anyone to inherit it and implement a context on their own. As well, since we are hiding the class via protected, the documentation will not show up in readthedocs anyways.

Copy link
Member

Choose a reason for hiding this comment

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

Still nice to have for us so if you mouse a call site, IDEs will show the docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I added to both.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still think it would be convenient to keep the documentation since there will be classes that will inherit from this one, but this is pretty much a nit, so approving.

@lzchen lzchen closed this Mar 10, 2021
@lzchen lzchen reopened this Mar 10, 2021
@lzchen lzchen merged commit c81fd5e into open-telemetry:main Mar 10, 2021
@lzchen lzchen deleted the ele branch March 10, 2021 18:32
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.

Consider hiding implementation elements
5 participants