type function does not subtype

Lenard Lindstrom nada at nowhere.xxx
Mon Mar 24 21:07:36 EST 2003


"Erik Max Francis" <max at alcyone.com> wrote in message
news:3E7E81EF.1992BFD4 at alcyone.com...
> Lenard Lindstrom wrote:
>
> > Would someone please explain why subtyping of type 'function' is not
> > permitted in Python 2.3?
>
> That would probably be best done by asking a counter question:  Why
> would you want to?
>...
I was just curious. While playing around with  function currying I tried to
subtype function to allow operator overloading. Given PEP 253 I wondered if
the language development team had run into some complications with type
function. As for uses, should not staticmethod and classmethod be subtypes
of function? If one wants a function wrapper that looks like a function,
e.g. has func_doc, func_code, and func_defaults members, should not that
wrapper class be derived from function? Maybe the wrapper is a proxy for
remote function calls. This is just conjecture. I am not yet familiar enough
with Python to know if it makes practical sense.

Lenard Lindstrom
"<%s@%s.%s>" % ("len-l.", "telus", "net")







More information about the Python-list mailing list