Skip to content

Commit 778aee8

Browse files
committed
Remove self from class initializer signature
1 parent ee4fa3c commit 778aee8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

quartodoc/renderers/md_renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _fetch_object_dispname(self, el: "dc.Alias | dc.Object"):
190190

191191
def _fetch_method_parameters(self, el: dc.Function):
192192
# adapted from mkdocstrings-python jinja tempalate
193-
if el.parent and el.parent.is_class and len(el.parameters) > 0:
193+
if (el.is_class or (el.parent and el.parent.is_class)) and len(el.parameters) > 0:
194194
if el.parameters[0].name in {"self", "cls"}:
195195
return dc.Parameters(*list(el.parameters)[1:])
196196

quartodoc/tests/__snapshots__/test_renderers.ambr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# quartodoc.tests.example_class.C { #quartodoc.tests.example_class.C }
4747

4848
```python
49-
tests.example_class.C(self, x, y)
49+
tests.example_class.C(x, y)
5050
```
5151

5252
The short summary.
@@ -112,7 +112,7 @@
112112
# quartodoc.tests.example_class.C { #quartodoc.tests.example_class.C }
113113

114114
```python
115-
tests.example_class.C(self, x, y)
115+
tests.example_class.C(x, y)
116116
```
117117

118118
The short summary.
@@ -178,7 +178,7 @@
178178
# quartodoc.tests.example_class.AttributesTable { #quartodoc.tests.example_class.AttributesTable }
179179

180180
```python
181-
tests.example_class.AttributesTable(self)
181+
tests.example_class.AttributesTable()
182182
```
183183

184184
The short summary.

0 commit comments

Comments
 (0)