This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients alexis, eric.araujo, higery, tarek, thomas.holmes
Date 2011-11-12.14:11:32
SpamBayes Score 2.1930195e-05
Marked as misclassified No
Message-id <1321107094.51.0.197622550379.issue12344@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-11-12 14:11:34eric.araujosetrecipients: + eric.araujo, tarek, thomas.holmes, alexis, higery
2011-11-12 14:11:34eric.araujosetmessageid: <1321107094.51.0.197622550379.issue12344@psf.upfronthosting.co.za>
2011-11-12 14:11:33eric.araujolinkissue12344 messages
2011-11-12 14:11:32eric.araujocreate