[New-bugs-announce] [issue27025] More human readable generated widget names

Serhiy Storchaka report at bugs.python.org
Sun May 15 04:04:05 EDT 2016


New submission from Serhiy Storchaka:

For now Tkinter generates Tk widget names just from Widget instance id.

>>> import tkinter
>>> root = tkinter.Tk()
>>> frame = tkinter.Frame(root)
>>> button = tkinter.Button(frame)
>>> str(button)
'.3070531884.3055478668'

These names are not very readable and distinguishable. I think it would be better to generate names from widget type and short sequential number. For example '.frame#1.button#2' or '.1frame.2button'.

There are some questions:

1. Should numbering be continuous or separate for different types of widgets?

2. Should a number precede or follow a widget type?

3. What separator, prefix or suffix be used? "#" looks too common and can lead to conflicts with user defined names or names generated by Tk or special Tk syntax.

----------
components: Tkinter
messages: 265591
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
status: open
title: More human readable generated widget names
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27025>
_______________________________________


More information about the New-bugs-announce mailing list