This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients epaine, serhiy.storchaka, shippo_
Date 2020-12-26.18:31:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1609007516.71.0.815792287204.issue42750@roundup.psfhosted.org>
In-reply-to
Content
a = tk.IntVar(name='a')
b = tk.IntVar(name='a')
assert a == b  # they refers to the same variable
assert a is not b  # but they are different objects
a.set(42); assert b.get() == a.get() == 42  # yes, it is the same variable
c = tk.IntVar(name='c', value=42)
assert c != a  # they are different variables
assert c.get() == a.get() == 42  # although having equal values
a.set(43); assert c.get() != a.get() == 43  # and setting one does not affect other

I do not see good reasons for making Tk variables comparable by value instead of name.
History
Date User Action Args
2020-12-26 18:31:56serhiy.storchakasetrecipients: + serhiy.storchaka, epaine, shippo_
2020-12-26 18:31:56serhiy.storchakasetmessageid: <1609007516.71.0.815792287204.issue42750@roundup.psfhosted.org>
2020-12-26 18:31:56serhiy.storchakalinkissue42750 messages
2020-12-26 18:31:56serhiy.storchakacreate