Skip to content

Python: all: review usage of kwargs and reduce as much as possible #3642

@eavanvalkenburg

Description

@eavanvalkenburg

Kwargs should only be used as a escape route, but not for well-known flows of data. In the long term this will protect us from bugs that arise from kwargs being used for mutiple purposes.

Overall guidance:

  • if there are known extra arguments being passed, reconsider if kwargs is the best way to do that, a named parameter in another function is likely the better approach
  • kwargs should be part of methods that are part of classes that are often/likely subclassed, so that the kwargs defined in the subclass do not cause issues, in that case, the kwargs should be clearly documented to be there for that purpose and not used for anything else.
  • In other cases, likely removing it is better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions