You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python doesn't really have keyword arguments (except when it does), only positionals. Thus, a call like foo(a=1) actually passes the value of argument a in its positional slot. The only case where keyword args have an independent existence is when a function has a **excess parameter to contain names not already defined in the parameter list.
Thus, we need some kind of binder process, either converting nameds to positionals or positionals nameds. Of course, this has to interact properly with default values and the like.
The text was updated successfully, but these errors were encountered:
The solution to this might be a custom HOW for function objects. The call handler can then stuff the right things into the right places, and the object can also carry around the default values to parameters.
A function object is supposed to have a member defaults containing the default values. A call handler can then nqp::clone that to get the default values. Next, populate actually passed values into the call arguments (there's no standard member with a name -> position mapping, but the inspect standard module needs it anyways). Once everything is set up, nqp::call(_args, *_excess_kw) or something along those lines.
There are still some things (mostly related to the semi-predicate problem, I think) to get checking of calls exactly right, though. But this should get us some things.
Python doesn't really have keyword arguments (except when it does), only positionals. Thus, a call like
foo(a=1)
actually passes the value of argumenta
in its positional slot. The only case where keyword args have an independent existence is when a function has a**excess
parameter to contain names not already defined in the parameter list.Thus, we need some kind of binder process, either converting nameds to positionals or positionals nameds. Of course, this has to interact properly with default values and the like.
The text was updated successfully, but these errors were encountered: