Skip to content

[Feature]: Fix position of StepContext in decorated class methods #261

@ngr

Description

@ngr

What would you like?

The current implementation of the @durable_step decorator injects the StepContext object as the first positional argument, moving self (instanse pointer) to the second position if it decorates an method inside a class. This contradicts the PEP8 requirements:

Always use self for the first argument to instance methods.
Always use cls for the first argument to class methods.

I suggest refactoring the decorator behavior while it's not too late, although this will become a breaking change for the currently decorated class methods already running.

I am ready to try to solve this if approved.

Is this a breaking change?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions