Can somebody please explain why both of lists are not equal? I mean output should be True but it's output is False. Why?
# CASE 1
list1 = []
for item in [self.home_btn, self.secret_dir_btn, self.info_btn]:
list1.append(QPropertyAnimation(item, b"size"))
# CASE 2
self.home_btn_anim = QPropertyAnimation(self.home_btn, b"size")
self.secret_dir_btn_anim = QPropertyAnimation(self.secret_dir_btn, b"size")
self.info_btn_anim = QPropertyAnimation(self.info_btn, b"size")
list2 = [self.home_btn_anim, self.secret_dir_btn_anim, self.info_btn_anim]
# Output
print(list1 == list2)
# Further code
Also, if I'm using case 1 to create the list, my further code doesn't work as it should. but using Case 2 to create the list makes the code work correctly. Why? and how can I solve it.
QPropertyAnimation. The class likely does not have an__eq__implemented for it that checks for equality between different instances based on some parameter. So all the objects are different__eq__method.