test() # throws TypeError: test() takes no arguments (0 given)
2. When the call binds to a failure when a value in `__kwdefaults__ ` is missing it still throws even if the value becomes available later on:
```Python
def test(*, a=1): return a
test.__kwdefaults__ = None
test() # throws TypeError as expected
test.__kwdefaults__ = {"a": 1}
assert test() == 1 # still throws the same TypeError as above
Not finding a value in __kwdefaults__ should throw a TypeError instead of returning None:
def test(*, a=1): return a
assert test() == 1
test.kwdefaults = None
test() # should throw but returns None instead
4. PythonFunction.CalculatedCachedCompat takes into account the number of arguments in `__kwdefaults__`. I don't think this makes sense since `__kwdefaults__` can be changed any time and there's no way to know.
5. More stuff I'm forgetting about...
Related PR: https://github.com/IronLanguages/ironpython3/pull/1018
Some issues I noticed while working on https://github.com/IronLanguages/ironpython3/issues/1015. The following examples need to be run in fresh ipy instances to exhibit the broken behavior.
test() # throws TypeError: test() takes no arguments (0 given)
__kwdefaults__
should throw aTypeError
instead of returningNone
:assert test() == 1 test.kwdefaults = None test() # should throw but returns None instead