Skip to content

Forbid to mix several argument types #1343

@sobolevn

Description

@sobolevn

Rule request

Thesis

This code contains two types of similar but different arguments:

def first(first: int = 0, *, second: int): ...

def second(first: int = 0, *, second: int = 0): ...

I would also say that these two groups does not work well together:

def first(first: int = 0, *args): ...

Reasoning

It is really hard to call these functions, their arguments are confusing. The best practice is not to mix positional with defaults and kw-only, positional with default and args.

This is a best-practice rule.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions