 ~/tmp   master ●  venv3.7.3/bin/python bad.py
sys.version: 3.7.3 (default, Apr 16 2019, 16:54:41)                                                                                                                                            
[GCC 6.3.0 20170516]                                                                                                                                                                           
sys.platform: linux                                                                                                                                                                            
QT_VERSION_STR: 5.13.0                                                                                                                                                                         
PYQT_VERSION_STR: 5.13.0                                                                                                                                                                       
SIP_VERSION_STR: 4.19.18                                                                                                                                                                       
                                                                                                                                                                                               
     ------ creating WidgetC and...                                                                                                                                                            
getting a:                                                                                                                                                                                     
           hasattr(self, 'ui') == True                                                                                                                                                         
           hasattr(self.ui, 'label') == True                                                                                                                                                   
got a                                                                                                                                                                                          
                                                                                                                                                                                               
     ------ creating WidgetC and... now it still works                                                                                                                                         
getting a:                                                                                                                                                                                     
           hasattr(self, 'ui') == True                                                                                                                                                         
           hasattr(self.ui, 'label') == True                                                                                                                                                   
got a                                                                                                                                                                                          
                                                                                                                                                                                               
     ------ creating WidgetB and...                                                                                                                                                            
getting a:                                                                                                                                                                                     
           hasattr(self, 'ui') == False                                                                                                                                                        
           hasattr(self, 'label') == True                                                                                                                                                      
                                                                                                                                                                                               
     ------ creating WidgetB and... now it breaks                                                                                                                                              
getting a:                                                                                                                                                                                     
           hasattr(self, 'ui') == False                                                                                                                                                        
           hasattr(self, 'label') == True                                                                                                                                                      
                                                                                                                                                                                               
     ------ creating WidgetA without breaking                                                                                                                                                  
getting a                                                                                                                                                                                      
got a                                                                                                                                                                                          
getting b                                                                                                                                                                                      
got b                                                                                                                                                                                          
                                                                                                                                                                                               
     ------ creating WidgetA but breaking in the process                                                                                                                                       
getting a                                                                                                                                                                                      
getting b