[PyQt] Why does python report this TypeError?

Barry Scott barry at barrys-emacs.org
Tue May 31 09:18:25 BST 2016


I'm using Python3.4, PyQt5.6, Qt5.6 as packaged by Fedora on  23.

WbGitMainWindow I change to multiple inherit to factor out
the chrome setup code. 

class WbGitMainWindow(QtWidgets.QMainWindow
                     ,wb_window_chrome_setup.WbWindowChromeSetup):
    def __init__( self, app ):
        QtWidgets.QMainWindow.__init__( self )
        wb_window_chrome_setup.WbWindowChromeSetup.__init__( self, 
image_store=wb_git_images )

Why oh Why does python report this:

Traceback...

  File "/home/barry/wc/git/git-workbench/Source/Git/wb_git_app.py", line 194, 
in __init__
    self.main_window = wb_git_main_window.WbGitMainWindow( self )
  File "/home/barry/wc/git/git-workbench/Source/Git/wb_git_main_window.py", 
line 64, in __init__
    QtWidgets.QMainWindow.__init__( self )


But image_store is a arg of WbWindowChromeSetup

Changing the code to this fixes the TB and the code seems to run without
error.


        QtWidgets.QMainWindow.__init__( self, image_store=None )

I'm very confused.

Barry



More information about the PyQt mailing list