Skip to content

No documentation rendered for return type when function has no arguments #1386

@lukastk

Description

@lukastk

No documentation is rendered for the return type, if the function has no arguments. Compare the two functions defined below:

#|export
def foo1(
        ) -> int: # Return type documentation
    """Docstring"""
    return 1

#|export
def foo2(
        a, # test
        ) -> int: # Return type documentation
    """Docstring"""
    return 1

The following documentation is rendered, after running nbdev_docs:

image

You can see that the return type is missing documentation in foo1.

You can find the reproduced bug in this repository:

https://github.com/lukastk/nbdev_method_doc_test

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions