On Monday, July 4, 2016 at 7:58:07 PM UTC+12, dieter wrote: > > Lawrence D’Oliveiro writes: > > > Some of the classes in Qahirah, my Cairo binding > <https://github.com/ldo/qahirah> I found handy to reuse elsewhere, for > example in my binding for Pixman <https://github.com/ldo/python_pixman>. > Subclassing is easy, but then you need to ensure that operations inherited > from the superclass return instances of the right class. This means that > superclass methods must never refer directly to the class by name for > constructing new objects; they need to obtain the current class by more > indirect means. > > --> "type(obj)" or "obj.__class__" (there are small differences) > give you the type/class of "obj".
OK, both updated. Funny how you find other bugs when revisiting code after a while. :) -- https://mail.python.org/mailman/listinfo/python-list