Skip to content

Lambda conditions no longer supported since v3.0? #638

Description

@renatoGarcia

Hi!

The following code currently work:

def my_condition(self) -> bool:
    return self.some_value

state_a.to(state_b, cond="my_condition")
state_c.to(state_c, cond=my_condition)

But passing a lambda directly does not:

state_a.to(state_b, cond=lambda self: self.some_value)

The v2.6 documentation suggests lambdas were accepted at one point. Was this lambda
support change intentional? It would be convenient to define simple guard conditions
inline without needing a named method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions