prototypes in Python [was: what is good in Prothon]
Greg Ewing
greg at cosc.canterbury.ac.nz
Tue May 4 00:54:34 EDT 2004
David MacQuigg wrote:
> On 1 May 2004 22:34:27 -0700, michele.simionato at poste.it (Michele
> Simionato) wrote:
>
>>Probably you do not realize that methods and functions are *already*
>>unified in Python: they are both examples of descriptors.
>
> Interesting! I wish that unification at the primitive level had been
> provided in the original design of Python.
It was. Methods have always been no more than functions that
happen to live in classes, and they still are. Descriptors are
a red herring here; they're just a generalisation that allows for
some new things. They don't unify anything that was previously
existing but not unified.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list