Member function names

Andrew Stribblehill a.d.stribblehill at dur.ac.uk
Fri Apr 7 18:25:48 CEST 2000


For some things, such as XML parsers, based on xmllib, I have to do
stuff like this:

class foo(XMLParser):
    start_h1:
        print "start_h1",
    end_h1:
        print "end_h1",

(etc)

Is there any way I can do something like this?

class foo(XMLParser):
    generic:
        print __member_function_name__,
    start_h1=generic
    end_h1=generic

(etc)


Note: this is an example which I've managed to solve neatly a
different way but I still want to know if such a trick is possible,
for other less tractible problems!

Thanks,

Andrew Stribblehill



More information about the Python-list mailing list