type function does not subtype

Greg Ewing (using news.cis.dfn.de) me at privacy.net
Mon Mar 24 23:44:27 CET 2003


Martin v. Löwis wrote:
> That won't work. If you create a function through the def statement,
> it will be of type function, not of a subclass thereof.

Maybe something like the __metaclass__ syntax is
called for:

   def myfunction(args):
     __functionclass__ = myspecialfunc
     ...

(I know that looks like a local variable assignment,
but it wouldn't be. As Guido once said about something else,
"It's a double-underscore name -- I can give it whatever
semantics I want!")

-- 
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