It seems like everybody's crazy about super() but is it really necessary in
most cases?
#Original pseudo-code, from another thread here.
class Ui_MainWindow(baseUIWidget, baseUIClass):
def __init__(self,parent=None):
super(Ui_MainWindow, self).__init__(parent)
#Edit: Calls the immediate base class
class Ui_MainWindow(baseUIWidget, baseUIClass):
def __init__(self, *args):
baseUIWidget.__init__(self, *args)
baseUIClass.__init__(self, *args)
also check this thread out:
http://bytes.com/topic/python/answers/709706-super-apply-__init__-when-subclassing
*
There is some debate about which to use especially in bigger dev
environments. Is it better speaking as a python 2.6 developer to
explicitly subclass or use super().__init__() in alignment with new class
object implementation? My tools are sometimes using multiple inheritance.
Keep in mind I haven't really written anything fully OOP that is widely
circulated.*
http://rhettinger.wordpress.com/2011/05/26/super-considered-super/
Just thought I'd crowd source some common practices here while I'm reading
up on the subject. Thanks!
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe