[New-bugs-announce] [issue42750] tkinter.Variable equality consistency

Ivo Shipkaliev report at bugs.python.org
Sat Dec 26 10:06:16 EST 2020

New submission from Ivo Shipkaliev <ivo.shipkaliev at gmail.com>:


I just noticed:

>>> import tkinter as tk
>>> root = tk.Tk()

>>> str_0 = tk.StringVar()
>>> str_0.set("same value")

>>> str_1 = tk.StringVar()
>>> str_1.set("same value")


>>> str_0.get() == str_1.get()


>>> str_0 == str_1

So, maybe a Variable should be compared by value, and not by identity (._name) as currently? (please view attached) Does it make sense?

components: Tkinter
files: equality.diff
keywords: patch
messages: 383807
nosy: epaine, serhiy.storchaka, shippo_
priority: normal
severity: normal
status: open
title: tkinter.Variable equality consistency
type: behavior
versions: Python 3.10
Added file: https://bugs.python.org/file49698/equality.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list