[Spambayes] Just visiting

Tim Peters tim.one@comcast.net
Thu Nov 21 03:15:50 2002

Making major progress on Zope3 has become a top priority for my (and
Guido's, and Jeremy's, and Barry's) employer, to an extent that precludes
Zope Corp work on projects that don't directly contribute to that.  This
project doesn't have beans to do with Zope, so my involvement here has
become a strictly "spare time" thing.  Since good news always comes in
threes, the first alpha of Python 2.3 is due out at the end of the year, and
large parts of what I wanted to accomplish there have also become "spare
time".  In most of my spare time since learning this, I've been waiting for
the third piece of good news <wink>.

I won't vanish, but I have to cut waaaaaay back on this list.  I'm proud of
what we've all accomplished here, and would hate to see it die -- especially
while it still sucks too much for my sisters to use <wink>.  In case you're
wondering, I approve of switching the default WordInfo thingie to compute
probs on demand, and will take the remaining minute of today's spare time to
remind that 2.2's properties would still allow for using .spamprob notation.

>>> class Whatever(object):
...     def _implementation_of_x_read_attr(self):
...         return 2.0 * 4
...     x = property(_implementation_of_x_read_attr)
>>> w = Whatever()
>>> w.x

s/x/spamprob/ and set your imagination free.  .spamprob can do anything, and
even different things when getting, setting, or deleting:

>>> print property.__doc__
property(fget=None, fset=None, fdel=None, doc=None) -> property attribute

fget is a function to be used for getting an attribute value, and likewise
fset is a function for setting, and fdel a function for del'ing, an
attribute.  Typical use is to define a managed attribute x:
class C(object):
    def getx(self): return self.__x
    def setx(self, value): self.__x = value
    def delx(self): del self.__x
    x = property(getx, setx, delx, "I'm the 'x' property.")

More information about the Spambayes mailing list