1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| attrib1 = sorted(list(dir(threading.Thread))) # liste des attributs de threading.Thread
attrib2 = sorted(list(dir(QtCore.QObject))) # liste des attributs de QtCore.QObject
print("attrib1:", attrib1)
print(len(attrib1))
print("attrib2:", attrib2)
print(len(attrib2))
communs = sorted(list(set(attrib1) & set(attrib2)))
print("Attributs communs:", communs) # attributs communs aux 2 ancêtres
print(len(communs))
# affichage:
attrib1: ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_bootstrap', '_bootstrap_inner', '_delete', '_initialized', '_reset_internal_locks', '_set_ident', '_set_native_id', '_set_tstate_lock', '_stop', '_wait_for_tstate_lock', 'daemon', 'getName', 'ident', 'isDaemon', 'is_alive', 'join', 'name', 'native_id', 'run', 'setDaemon', 'setName', 'start']
48
attrib2: ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'blockSignals', 'childEvent', 'children', 'connectNotify', 'customEvent', 'deleteLater', 'destroyed', 'disconnect', 'disconnectNotify', 'dumpObjectInfo', 'dumpObjectTree', 'dynamicPropertyNames', 'event', 'eventFilter', 'findChild', 'findChildren', 'inherits', 'installEventFilter', 'isSignalConnected', 'isWidgetType', 'isWindowType', 'killTimer', 'metaObject', 'moveToThread', 'objectName', 'objectNameChanged', 'parent', 'property', 'pyqtConfigure', 'receivers', 'removeEventFilter', 'sender', 'senderSignalIndex', 'setObjectName', 'setParent', 'setProperty', 'signalsBlocked', 'startTimer', 'staticMetaObject', 'thread', 'timerEvent', 'tr']
69
communs pour 1 et 2: ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
26 |
Partager