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

ModuleProxy doesn't preserve module docstring #5

Closed
jamadden opened this issue Oct 24, 2017 · 0 comments
Closed

ModuleProxy doesn't preserve module docstring #5

jamadden opened this issue Oct 24, 2017 · 0 comments
Labels

Comments

@jamadden
Copy link
Member

So using deprecatedFrom or deferredFrom, etc, suddenly breaks your Sphinx documentation.

Given foo.py:

"""
This is foo.py
"""
from zope.deferredimport import deprecatedFrom
deprecatedFrom("These live in bar",
               "bar",
               "fizzbin")

You can't get its docstring:

>>> import foo
>>> foo.__doc__
None

This doesn't seem to be a problem in the ProxyBase that ModuleProxy extends:

In [1]: class O(object):
   ...:     """Hi"""
   ...:

In [2]: O.__doc__
Out[2]: 'Hi'

In [3]: O().__doc__
Out[3]: 'Hi'

In [4]: from zope.proxy import ProxyBase

In [5]: proxy = ProxyBase(O)

In [6]: proxy.__doc__
Out[6]: 'Hi'

In [7]: proxy = ProxyBase(O())

In [8]: proxy.__doc__
Out[8]: 'Hi'

(Very vaguely related: zopefoundation/zope.hookable#6)

@jamadden jamadden added the bug label Oct 24, 2017
jamadden added a commit that referenced this issue Oct 24, 2017
Preserve docstrings of proxied modules. Fixes #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant