◐ Shell
clean mode source ↗

Message 208455 - Python tracker

Your fixes for #1 and #2 were fine, I've incorporated them into the patch.  I'll update the diff after I've added the tests Nick suggested.

The assertion failure in #3 will also be gone, replaced with a failure:

  You can't have two parameters named module!

The problem is that we silently inserted a self converter for the first argument, and because this is a module-level function, that "self" parameter is naturally named "module".

I have a fix in mind for this: basically to teach Argument Clinic that the parser function and impl function have different namespaces, and to map names in the first to the second.  So, you could have a parameter named "args", and Clinic would notice, and rename the variable in the parser function "args_value" or something, and then pass it in in the right spot.  Once I've done that, it'd be easy to make it also rename the secret self converter name to "_module" or something.  Anyway, long story short, let's not try to fix #3 in this patch.