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

Allow to dispatch getting documentation on objects. #13975

Merged
merged 1 commit into from
Mar 30, 2023

Commits on Mar 30, 2023

  1. Allow to dispatch getting documentation on objects

    Base for ipython#13860, so that object can be queried for documentation on
    their fields/properties.
    
    Typically this allows the following, to extend the doc documentation
    when requesting information on a field.
    
        In [1]: class DictLike:
           ...:     def __getitem__(self, k):
           ...:         if k.startswith('f'):
           ...:             return "documentation for k"
           ...:         else:
           ...:             raise KeyError
           ...:
           ...: class Bar:
           ...:     __custom_documentations__ = DictLike()
           ...:
           ...:     faz = 1
           ...:
           ...:
           ...:     @Property
           ...:     def foo(self):
           ...:         return 1
           ...: b = Bar()
    
        In [2]: b.faz?
    Carreau committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    fc872d6 View commit details
    Browse the repository at this point in the history