Skip to content

Conversation

@stefanv
Copy link
Contributor

@stefanv stefanv commented Jan 21, 2026

Closes gh-87

# bound: length of the parameter, plus three (for
# space-colon-space).
arg_type = re.sub(rf" {{{N + 3},}}", " ", arg_type_w_whitespace)
else:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may not be following entirely but this seems wrong to me? Can it deal with the formatting below, where arg_name is quite long?

"""
Parameters
----------
very_long_arg_name : type wrapped \
        over multiple lines
    Description goes here.
"""

Why not just use

re.sub(r"\s{2,}", " ", arg_type_w_whitespace)

\s should also be able to deal with non-breaking spaces and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convention for multi-line type specifications

2 participants