Skip to content

@swim function crashes when re-evaluated with less arguments #260

Open
@loig

Description

When evaluating this:

@swim
def somePrints(k=0):
    print("v1:", k)
    again(somePrints, k=k+1)

and then this:

@swim
def somePrints():
    print("v2:", somePrints.iter)
    again(somePrints) 

Sardine will fail to update the function somePrints:

v1: 11

[Updating somePrints]

[Function exception | (somePrints)]

Traceback (most recent call last):

  File "/home/loig/Boulot/Recherche/live-coding/sardine/sardine_core/scheduler/async_runner.py", line 615, in _runner
    await self._run_once()
  File "/home/loig/Boulot/Recherche/live-coding/sardine/sardine_core/scheduler/async_runner.py", line 721, in _run_once
    await asyncio.create_task(
  File "/home/loig/Boulot/Recherche/live-coding/sardine/sardine_core/scheduler/async_runner.py", line 745, in _call_func
    return await maybe_coro(func, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/loig/Boulot/Recherche/live-coding/sardine/sardine_core/utils/__init__.py", line 77, in maybe_coro
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
TypeError: somePrints() got an unexpected keyword argument 'k'

[Saving somePrints from crash]

v1: 12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions