[MERGE] Patience diff

Robert Collins robertc at robertcollins.net
Mon May 29 23:41:31 BST 2006


On Fri, 2006-05-26 at 11:59 +1000, Martin Pool wrote:
> On 25 May 2006, John Arbash Meinel <john at arbash-meinel.com> wrote:


> Point for discussion: when we have a name that's used as a callable
> factory, how should it be named?  One way is to name it like a class, as
> you have here, which makes it clear that you're meant to treat it like a
> constructor.   On the other hand it may be a bit surprising that it
> doesn't generate instances of SequenceMatcher.  It might be better to
> call it, say, sequencematcher_class, or sequencematcher_factory.  (This
> is a bit theoretical; don't let it block your merge but I wondered what
> people thought.)

I think that things named FooBar should create instances of FooBar when
called. Its plain confusing for them to do otherwise. When we have
something that is going to be used as a class - that is, checked for via
isinstance or other such idioms, them I would call it foo_class, so that
it is clear that a callable is not sufficient. If it is only used as a
factory, then yes, foo_factory is what I would use.

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/20060530/33b4798d/attachment.pgp 


More information about the bazaar mailing list