Skip to content

change: Make signatures formatting more consistent? #193

@pawamoy

Description

@pawamoy

Reported on Matrix.

One rather small nit with signatures, when using separate signatures formatted by Black, is that the formatting varies depending on how many arguments there are and how long they and their possible types and default valus are. All these formats are possible:

compact(arg: int) -> bool

semi_compact(
    first_arg: int, second_arg: int
) -> int

verbose(
    first_arg: int = 1,
    second_arg: int = 2,
    third_arg: int = 3
) -> int

I undertand why the format changes and it isn't a big problem, but it is still somewhat confusing and inconsistent if two functions in same module have different signature formats. It would be great if there was a way to force the verbose style to be used always or, perhaps better, always when there's more than one parameter. Unless Black has a such configuration option this may be too hard to implement, though, and Black isn't known for supporting much configuration.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions