function override???

Oleg Broytmann phd at
Tue Nov 16 18:17:42 CET 1999

On Tue, 16 Nov 1999, Arinte wrote:
> I am defining a python callback for my embedded app, but I want the script
> writer to override my function.  So, basically what I want is a function
> prototype.  Ex. here is what I am thinking.
> ;
> def overrideme(self, str, someint)
> ;
> import fprot   #I know this ain't right.
>                           # I don't know how to import from other python
> scripts yet.  Enlighten me?

   I ithink it is correct. Why do you think it is not?

> def overrideme(self, str, someint)
>     do_some_junk()

   Define your procedure:

def overrideme(self, str, someint):

import fprot

   And assign your override function:

fprot.overrideme = my_override

   After this, call fprot.overrideme from any place (C or Python).

    Oleg Broytmann      Foundation for Effective Policies      phd at
           Programmers don't die, they just GOSUB without RETURN.

More information about the Python-list mailing list