Automatic reloading, metaclasses, and pickle

Ziga Seilnacht ziga.seilnacht at gmail.com
Tue Feb 27 18:47:40 EST 2007


Andrew Felch wrote:

> Thanks for checking.  I think I narrowed the problem down to
> inheritance.  I inherit from list or some other container first:
>
> class PointList( list, AutoReloader ):
>     def PrintHi1(self):
>         print "Hi2"
>
> class MyPrintingClass( AutoReloader ):
>     def PrintHi2(self):
>         print "Hi2v2"
>
> Automatic reloading works for MyPrintingClass but not for PointList.
> Any ideas?
>
> -Andrew

Ah yes, this is the problem of list.__new__ not calling the next
class in MRO. Try to switch the bases, so that AutoReloader's
__new__ method will be called first.

Ziga




More information about the Python-list mailing list