I was working on moving TG dispatch to Crank, and I found an issue
related to a different behavior of util.method_matches_args in Crank.

The issue is related to the fact that required_vars (the list of
method arguments which are required) is created using only the
arguments that do not have a default value.
This is the desired behavior, but then required_vars gets iterated to
see how many arguments of the required ones are matched from the
request parameters, each time a parameter matches it gets removed from
the parameters dict. If the parameters dict ends not being empty the
code decides that all the parameters still there are there because
they do not match with any method argument.

The issue is that this is actually not true, all the parameters that
have a default value end being inside that dict as they are not
removed as they do not appear inside the required_vars as they have a
default value and so they are not required.

how required_vars is handled should probably be changed, or this check
has probably to be changed.

    #make sure no params exist if keyword argumnts are missing
    if not lax_params and argkws is None and params:
        return False

Chris, can you take a look at this? I would be more confident if you
handle this issue instead of me as it would probably change the
behavior of Crank and it might end breaking compatibility with other
projects.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" group.
To post to this group, send email to turbogears-trunk@googlegroups.com.
To unsubscribe from this group, send email to 
turbogears-trunk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en.

Reply via email to