check for non valid object
say i have such code:
... self.mw = QMainWindow() self.create_dock_widgets() ... def create_dock_widgets(self): # should i check if window is valid object? self.mw.addDockWidget...
should i actually do it?
And do what if it isn't? You're only going to
raiseanyway if it isn't. Plus
self.mw = QMainWindow()would have
raised in the first place if it couldn't create a main window.
Of course you can check everywhere if you wish. But that can be a lot of code. I wouldn't bother here.
Unless you're doing it for a school project. In which case, goodness knows...