-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Updating to master, noticed a new issue relating to kwargs. Last working commit is bb70874. On commit 1e99d29, I get a core dump, and 783b1a8 onwards, I get a TypeError.
I'm running IDF v4.4. I'm running this on ESP S3.
ERROR 2e3f204 (HEAD -> master, origin/master, origin/HEAD) py/runtime: Use size_t/ssize_t instead of uint/int.
4768518 tests/basics/fun_callstardblstar: Add coverage test.
9b74d71 py/runtime: Drop new_alloc < 4 check.
3679a47 py/runtime: Do not overallocate when len is known.
ERROR 783b1a8 py/runtime: Allow multiple *args in a function call.
LoadProhibited 1e99d29 py/runtime: Allow multiple **args in a function call.
PASS bb70874 py/vm: Prevent array bound warning when using -MP_OBJ_ITER_BUF_NSLOTS.
Here's the test case. This schtick on this one is direct instantiation of kwargs is working fine. Which is why it probably passed test cases (and why this was a little tricky to find). But when you pass kwargs through a function, I see the issue.
def kwargs_test1(kwargs):
KwargsTest(**kwargs)
class KwargsTest():
def __init__(self, hello = None,
world = False,
):
pass
kwargs = {'hello':True}
#direct instantiation works across commits
KwargsTest(**kwargs)
# <KwargsTest object at 3d832510>
#calling via function causes error on new commits
kwargs_test1(kwargs=kwargs)
# on commit bb7087411 and earlier, no error.
# on commit 1e99d29f3 core panic
# on commit 783b1a868 and owwards, I get this:
# Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
# File "main.py", line 189, in kwargs_test1
# TypeError: can't convert dict to int