Message383853
"I personally think that being able to compare whether two tkinter variables point to the same Tk variable is very useful so needs to stay in some form." -- I concur.
"However, I don't see any situation where comparing to see if two tkinter variables are the same Python object would be helpful." -- agreed.
"Therefore, while writing 'a.get() == b.get()' isn't too bad, .." -- it isn't. But "a == b" -> False IS, provided that "a.get() == b.get()" is True.
Serhiy, how about:
> class Variable:
> ...
> def is_(self, other): # or maybe "same_as"
> return self.__class__.__name__ == other.__class__.__name__ \
> and self._name == other._name
>
> def __eq__(self, other):
> return self.__class__.__name__ == other.__class__.__name__ \
> and self.get() == other.get()
Regards |
|
Date |
User |
Action |
Args |
2020-12-27 16:21:35 | shippo_ | set | recipients:
+ shippo_, serhiy.storchaka, epaine, RhinosF1 |
2020-12-27 16:21:35 | shippo_ | set | messageid: <1609086095.18.0.307598304178.issue42750@roundup.psfhosted.org> |
2020-12-27 16:21:35 | shippo_ | link | issue42750 messages |
2020-12-27 16:21:35 | shippo_ | create | |
|