Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Style
  • Loading branch information
erlend-aasland committed Jul 4, 2023
commit 248ab0808c17ef2a22d6ca85bcb3d7d31fbdb179
17 changes: 14 additions & 3 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@ def strip_leading_and_trailing_blank_lines(s: str) -> str:
return '\n'.join(lines)

@functools.lru_cache()
def normalize_snippet(s: str, *, indent=0) -> str:
def normalize_snippet(
s: str,
*,
indent: int = 0
) -> str:
"""
Reformats s:
* removes leading and trailing blank lines
Expand All @@ -599,7 +603,11 @@ def normalize_snippet(s: str, *, indent=0) -> str:
return s


def declare_parser(f: Function, *, hasformat=False) -> str:
def declare_parser(
f: Function,
*,
hasformat: bool = False
) -> str:
"""
Generates the code template for a static local PyArg_Parser variable,
with an initializer. For core code (incl. builtin modules) the
Expand Down Expand Up @@ -658,7 +666,10 @@ def declare_parser(f: Function, *, hasformat=False) -> str:
return normalize_snippet(declarations)


def wrap_declarations(text: str, length=78) -> str:
def wrap_declarations(
text: str,
length: int = 78
) -> str:
"""
A simple-minded text wrapper for C function declarations.

Expand Down