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

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

Closed
radao opened this issue Mar 16, 2022 · 2 comments
Closed

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

radao opened this issue Mar 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@radao
Copy link

radao commented Mar 16, 2022

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
@pawamoy
Copy link
Member

pawamoy commented Mar 30, 2022

Confirmed on Python 3.7 (greater versions seem unaffected). Thanks for the report 🙂

@pawamoy pawamoy added the bug Something isn't working label Mar 30, 2022
pawamoy pushed a commit to mkdocstrings/griffe that referenced this issue Apr 1, 2022
Issue #59: #59
Issue mkdocstrings/python#8: mkdocstrings/python#8
PR #60: #60
Co-authored-by: Thomas PETIT-JEAN <thomas.petitjean-ext@aphp.fr>
Co-authored-by: Timothée Mazzucotelli <pawamoy@pm.me>
@pawamoy
Copy link
Member

pawamoy commented Apr 2, 2022

Fixed in Griffe 0.14.1

@pawamoy pawamoy closed this as completed Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants