RELEASED: Python 2.2a1

Terry Reedy tjreedy at home.com
Thu Jul 19 02:24:17 CEST 2001


"Guido van Rossum" <guido at digicool.com> wrote in message
news:mailman.995464538.29395.python-list at python.org...
...
> I'm writing an introduction to the type/class unification:
>
>   http://www.python.org/2.2/descrintro.html

This intro also describes some neat 'by-product' features that I have
missed seeing mentioned on the newsgroup:

* Static methods (and class methods also): If this does not stop people
from asking 'how do I write static class methods', at least now we will be
able to say follow 'def f...' with 'f  = staticmethod(f)' instead of 'you
cannot' and 'here is a kludgy workaround'.

* A getset typeclass that allows us to have our cake (the nice
instance.attr notation) and eat it too (by having such accesses optionally
rerouted to attribute-specific get and set methods instead of all-attribute
__get/setattr__).  This will end discussions about which now-unnecessary
compromise to make.

These are nice improvements in the Python class model.  There is also an
improved base-class lookup rule at least for type-based classes.

Terry J. Reedy






More information about the Python-list mailing list