@davidfor: That's a bug in PyQt6. Just use the literal 1000 it should work in both. Or if you want to be elegant:
Code:
try:
MyType = QTableWidgetItem.ItemType.UserType.value
except AttributeError:
MyType = QTableWidgetItem.UserType
Sadly, Phil decided to move PyQt to using python enums in PyQt6 and caused endless bugs and breakage in the process. There are literally hundreds of commits I've had to make to fix all the breakage this decision has caused.