Skip to content

Commit 3a760ac

Browse files
committed
fix: Stop propagation of annotation to next parameter in signature template
Issue mkdocstrings#110: mkdocstrings#110
1 parent 2d7c3fc commit 3a760ac

File tree

1 file changed

+4
-4
lines changed
  • src/mkdocstrings_handlers/python/templates/material/_base

1 file changed

+4
-4
lines changed

src/mkdocstrings_handlers/python/templates/material/_base/signature.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
)
1212
-%}
1313

14-
{%- if config.show_signature_annotations -%}
15-
{%- set ns.equal = " = " -%}
16-
{%- endif -%}
17-
1814
(
1915
{%- for parameter in function.parameters -%}
2016
{%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%}
@@ -31,13 +27,17 @@
3127
{%- endif -%}
3228

3329
{%- if config.show_signature_annotations and parameter.annotation is not none -%}
30+
{%- set ns.equal = " = " -%}
3431
{%- if config.separate_signature and config.signature_crossrefs -%}
3532
{%- with expression = parameter.annotation -%}
3633
{%- set ns.annotation -%}: {% include "expression.html" with context %}{%- endset -%}
3734
{%- endwith -%}
3835
{%- else -%}
3936
{%- set ns.annotation = ": " + parameter.annotation|safe -%}
4037
{%- endif -%}
38+
{%- else -%}
39+
{%- set ns.equal = "=" -%}
40+
{%- set ns.annotation = "" -%}
4141
{%- endif -%}
4242

4343
{%- if parameter.default is not none and parameter.kind.value != "variadic positional" and parameter.kind.value != "variadic keyword" -%}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy