Open Gouvernathor opened 8 months ago
@Gouvernathor Can you taker your new pull requests out of draft status, so I can merge them? (Also, a short description other than the title would help.)
They are not tested and need to be, I will do it eventually.
When an ATL transform is called, three things happen : the inner scope is updated (as with any call in renpy ot python), the parameters are curryfied and prepared for a potential next call, and the child of the transform is updated. All three of these are buggy. Some parameters are not managed and treated as they should : pos-only are treated as pos-or-kw, required kw-only are not handled and cause exceptions, and variadic parameters are rejected at parse time. This affects the inner scope update and the correct currying of parameters for the next call. The rules for setting the child are not consistent, resulting in the very function made to do it (At) failing in some edge cases, not to mention when you call the transform directly (not everyone uses At).
4403
5099
_ignore_extra_kwargs
order, if possible.4371
4799
5592
5593
5237
5237
At
not setting the child sometimeschild
local variable in ATL, regardless of the signature (a pure improvement, not a fix, but taking it into account in the previous steps will help)4405
5591
As a sidenote, a difficulty when currying ATL is that in the resulting signature, the default values of the passed parameters are actual, evaluated values, whereas a "raw" ATL transform has evaluable expressions as default values of the optional parameters. Properly managing that will probably require two Signature classes, or two Parameter classes, or both. The current code gets around that by putting only required positional parameters in the signature, and treating values already in the scope as acceptable keyword-arguments. But that's incompatible with pos-only parameters, which set a matching entry in the scope yet aren't acceptable as keyword arguments. From this point of view, enabling kw-only parameters will be simpler than enabling args, kwargs or pos-onlies.