We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e1e8da commit 73b7c47Copy full SHA for 73b7c47
mypy/stubgenc.py
@@ -579,6 +579,9 @@ def generate_function_stub(
579
if not isinstance(docstring, str):
580
docstring = None
581
582
+ if docstring:
583
+ docstring = self._indent_docstring(docstring)
584
+
585
ctx = FunctionContext(
586
self.module_name,
587
name,
@@ -612,11 +615,7 @@ def generate_function_stub(
612
615
if inferred[0].args and inferred[0].args[0].name == "cls":
613
616
decorators.append("@classmethod")
614
617
- output.extend(
- self.format_func_def(
- inferred, decorators=decorators, docstring=self._indent_docstring(docstring)
618
- )
619
+ output.extend(self.format_func_def(inferred, decorators=decorators, docstring=docstring))
620
self._fix_iter(ctx, inferred, output)
621
622
def _indent_docstring(self, docstring: str) -> str:
0 commit comments