We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a class attribute is implemented as a data descriptor, pdoc doesn't seem to be able to capture its docstring correctly.
For instance, put the code below into a module called descriptor.py and run pdoc on it.
class Descriptor(): def __init__(self, func): self.__doc__ = func.__doc__ def __get__(self, instance, owner): return self if instance is None else getattr(instance, "_x", 0) def __set__(self, instance, value): instance._x = value class Dummy: @Descriptor def size(self): """This is the size"""
The result is like this:
i.e. the size attribute is correctly identified as a Descriptor instance, but its __doc__ is not captured.
Descriptor
__doc__
Now remove method __set__ from the Descriptor class, so that it is a non-data descriptor. This changes the result to:
__set__
i.e. now the docstring is present.
pdoc: 6.3.1 Python: 3.7.9 Platform: Windows-10-10.0.19041-SP0
The text was updated successfully, but these errors were encountered:
Good catch, thanks for the detailed description! Could you please verify that #227 behaves as expected? 😃
Sorry, something went wrong.
I had a look, seems fine now! Thanks for the super quick turnaround! 😃
326146a
Exellent.! 6.3.2 is out in a few minutes. 😃
Successfully merging a pull request may close this issue.
Problem Description
When a class attribute is implemented as a data descriptor, pdoc doesn't seem to be able to capture its docstring correctly.
For instance, put the code below into a module called descriptor.py and run pdoc on it.
The result is like this:
i.e. the size attribute is correctly identified as a
Descriptor
instance, but its__doc__
is not captured.Now remove method
__set__
from theDescriptor
class, so that it is a non-data descriptor. This changes the result to:i.e. now the docstring is present.
System Information
The text was updated successfully, but these errors were encountered: