How could I implement a virtual method and override it in python?

wesley.keeling at iugome.com wesley.keeling at iugome.com
Wed Sep 14 18:51:08 EDT 2016


On Wednesday, September 14, 2016 at 3:47:52 PM UTC-7, Lawrence D’Oliveiro wrote:
> On Thursday, September 15, 2016 at 10:18:09 AM UTC+12, wesley.... at iugome.com wrote:
> > Helper.py:
> > 
> > def Foo( *args ):
> > 	print ("This is a callback")
> > 
> > def Run:
> >     Foo()
> > 
> > 
> > MyModule.py:
> > 
> > import Helper
> > 
> > def Foo( *args ):
> > 	print ("I want to be the new callback")
> 
> Overrides and subclassing applies to classes, not modules.

Yeah I assumed so, is there any ways I can get this to work with the importing of the helper?



More information about the Python-list mailing list