Replies: 1 comment 1 reply
-
| 
         The investigation is sound. It looks like we should allow   | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I'm almost done working on a feature to enhance sphinx docstring handling of parameter types when defined with
:param a_type foo:or:param foo:+:type foo: a_typepair, by passing the annotation throughparse_docstring_annotation()like the google docstrings.I'm writing some new unit tests for this, and the type annotations for
ExprNamedoesn't allow the parent to be a Function object. However, when runningmkdocs buildon a real project (for example astroid) through a debugger, with an editable installation of griffe, with breakpoints in the sphinx.py file, the parent passed in theDocstringobject is really aFunctionobject, and in the parsed annotation as expressions (likeparse_docstring_annotation()returns), the parts whereExprNameare used, they have their parent attribute set to the function that the docstring is parsed from.The type annotation for parent of
ExprNameare defined here:griffe/src/_griffe/expressions.py
Lines 595 to 603 in b18b63d
Beta Was this translation helpful? Give feedback.
All reactions