Skip to content

Default values are not displayed for types other than string #8

@radao

Description

@radao

Describe the bug
Using type hints and enabling show_signature_annotations displays each parameters type correctly, but not default value unless its a string.

To Reproduce
Steps to reproduce the behavior:

  1. Define a method such as def foo(a: str = 'hello', b: int = 10, c: bool = False, d: str = 'world') -> None
  2. Enableshow_signature_annotations in your mkdocs.yml:
plugins:
  - mkdocstrings:
      handlers:
        python:
          rendering:
            show_signature_annotations: True
  1. Observe in the generated docs only the string fields default values are displayed (ie a and d).

System (please complete the following information):

  • mkdocs versions:
mkdocs==1.2
mkdocstrings==0.18.1
mkdocstrings-python==0.6.6
  • Python version: 3.7
  • OS: Linux

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