Skip to content

Commit

Permalink
refactor: Always hide self and cls parameters
Browse files Browse the repository at this point in the history
Issue #7: #7
  • Loading branch information
pawamoy committed Mar 5, 2022
1 parent 2ec638e commit 7f579d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
{%- with function = class.members["__init__"] -%}
{%- filter highlight(language="python", inline=True) -%}
{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
{% with no_self = True %}
{%- include "signature.html" with context -%}
{% endwith %}
{%- include "signature.html" with context -%}
{%- endfilter -%}
{%- endwith -%}
{% else %}
Expand All @@ -45,7 +43,7 @@

{% if config.separate_signature and config.merge_init_into_class %}
{% if "__init__" in class.members %}
{% with function = class.members["__init__"], no_self = True %}
{% with function = class.members["__init__"] %}
{% filter highlight(language="python", inline=False) %}
{% filter format_signature(config.line_length) %}
{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

(
{%- for parameter in function.parameters -%}
{%- if parameter.name != "self" or not no_self -%}
{%- if parameter.name not in ("self", "cls") or loop.index0 > 0 or not (function.parent and function.parent.is_class) -%}

{%- if parameter.kind.value == "positional-only" -%}
{%- if ns.render_pos_only_separator -%}
Expand Down

0 comments on commit 7f579d1

Please sign in to comment.