[MERGE REVIEW] create_checkout_convenience

Robert Collins robertc at robertcollins.net
Mon Aug 7 07:43:45 BST 2006


On Mon, 2006-08-07 at 15:00 +1000, Martin Pool wrote:
> On  4 Aug 2006, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> > I want to get nested trees in, but it's a big chunk to digest.  There
> > are a few bits I can break out, and this is one.
> > 
> > It introduces create_checkout_convenience, which was something I needed
> > for the nested-trees test cases.  No reason it can't go in first, right?
> 
> I like the concept and that you removed this from the builtin command.
> 
> However I think the proliferation of staticmethods for such things is a
> bad trend and I'd rather we don't add another.  Somehow they don't seem
> to work well in Python, partly because there's just a single namespace
> for instance variables, instance methods, and class methods.
> 
> When talking to Robert the other day I proposed this rule: static/class
> methods should be confined to the "named constructor" pattern.

For clarity - an example of a named constructor is WorkingTree.open, or
WorkingTree.create - both of these return a WorkingTree, but their name
gives a much better hint about what they do than
'WorkingTree('/tmp/foo', True)' does.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060807/e7952d0c/attachment-0001.pgp 


More information about the bazaar mailing list