[Zope3-dev] RE: [Zope3-checkins] CVS: Zope3/lib/python/Zope/TextIndex - TextIndexInterfaces.py:1.3 TextIndexWrapper.py:1.3

Steve Alexander steve@cat-box.net
Wed, 04 Dec 2002 20:23:04 +0000


Gary Poster wrote:
> +class IStatistics(Interface):
> +
> +    def documentCount():
> +        """Return the number of documents currently indexed."""
> +
> +    def wordCount():
> +        """Return the number of words currently indexed."""
> 
> Hey.  I assume documentCount is a part of the same interface as
> wordCount because TextIndex goes in the Zope directory and all the other
> index stuff goes in the App/index directory (lower in the tree), but...
> 
> FWIW, documentCount does seem like a more generically useful statistic
> for an index than wordCount, and it seems like it might be nice to
> factor out.  Somewhere.  ;-)
> 
> Also, you're the best person to answer this in the universe, I imagine,
> so out of curiosity, why aren't these attributes in the interface and
> implemented as Python 2.2 properties?

They are methods because we're 'wrapping' 
Zope/TextIndex/TextIndexWrapper.py with a Zope3-specific derived class, 
in Zope/App/index/text.

So, it is easier to make them methods than properties.

We're not making a generically-applicable interface right now, just 
building something specific for the goals of this sprint.

Making generic stuff will happen later, with a little refactoring.

--
Steve Alexander