-
Notifications
You must be signed in to change notification settings - Fork 651
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fixes #1640