inngest / inngest-py

Python SDK for Inngest
https://www.inngest.com/docs/reference/python
Apache License 2.0
24 stars 6 forks source link

Add support for step callback args #87

Closed goodoldneon closed 3 months ago

goodoldneon commented 3 months ago

Add support for step.run callback arguments.

Before this PR, step.run callbacks could only receive args via a lambda:

def do_thing(id: int) -> None:
  pass

step.run("my-step", lambda: do_thing(1))

Now you can also do this:

def do_thing(id: int) -> None:
  pass

step.run("my-step", do_thing, 1)
masylum commented 3 months ago

I think this broke the types for the no argument case. CleanShot 2024-05-10 at 11 31 58

goodoldneon commented 3 months ago

Which mypy version are you using? We're passing no arg callbacks in our tests (which we run mypy against): https://github.com/inngest/inngest-py/blob/main/tests/test_function/cases/change_step_error.py#L64