[issue42750] tkinter.Variable equality inconsistency

E. Paine report at bugs.python.org
Sun Dec 27 07:35:52 EST 2020


E. Paine <paineelisha at gmail.com> added the comment:

See also issue41851. 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. However, I don't see any situation where comparing to see if two tkinter variables are the same Python object would be helpful.

Comparing to a list (for example), `assert a is b` would mean altering one would affect the other (while this is true of tkinter variables, to cover all cases you would instead check whether they are 'equal'). Therefore, while writing `a.get() == b.get()` isn't too bad, the point of this change would be consistency more than anything else (as-per the title).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42750>
_______________________________________


More information about the Python-bugs-list mailing list