Éric Araujo <mer...@netwok.org> added the comment: I’ve spent some time on this.
First, I decided that the former name (reinitialize_command) of the method was better. The get_* name could create the impression that the returned object was independent from the internal caches (command_obj, have_run), but it was not. I changed the name back (not pushed yet; I can’t push today). Second, I wrote tests before adding **kwargs. It turns out I ended up removing two buggy lines in dist.py! Thomas, if you could review that patch to tell me 1) if you can understand what it’s doing 2) if removing the two lines was right (they’ve been here since the first commit; on one hand there were no tests, but on the other there were commands depending on that code that did work well), that would be a great help. You’ve dug into that code, so if you can’t follow my patch it’d be a sign that it needs more comments. Finally, adding **kwargs was a two-line change in dist.py, a cleanup in some commands to use it, and two more tests. BTW, some things I said were stupid: >> In Distributions.get_reinitialized_command should the >> reinitialization of the subcommands also get passed the kwargs? > Yes, the kwargs need to be passed all the way. That made no sense. Subcommands don’t have the same options as their parent. The kwargs are only for the command given as argument; to edit the options of a subcommand, reinitialize_command needs to be called for that subcommand too. >> Unfortunately my understanding of the (sub)command flow is not rock solid. My reply to that was off-mark. Documenting how subcommands work is on my todo list, and I’ll be glad to have your feedback on that if you have time. ---------- stage: -> patch review title: Add **kwargs to get_reinitialized_command -> Add **kwargs to reinitialize_command versions: +3rd party _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12344> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com