[MERGE] Patience diff
Martin Pool
mbp at canonical.com
Sun Jun 4 11:58:51 BST 2006
On 30 May 2006, Robert Collins <robertc at robertcollins.net> wrote:
> 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.
Right, I think this is good too. I'll add it to the standards.
--
Martin
More information about the bazaar
mailing list