Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
loig opened this issue Jun 19, 2024 · 1 comment
Open

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

loig opened this issue Jun 19, 2024 · 1 comment
Labels
bug Something isn't working enhancement New feature or request

Comments

@loig
Copy link

loig commented Jun 19, 2024

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
@Bubobubobubobubo Bubobubobubobubo changed the title swim function crashes when re-evaluated with less arguments @swim function crashes when re-evaluated with less arguments Jun 19, 2024
@Bubobubobubobubo Bubobubobubobubo added bug Something isn't working enhancement New feature or request labels Jun 19, 2024
@Bubobubobubobubo
Copy link
Owner

Started implementing a fix with 4e98343.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants