[issue27025] More human readable generated widget names

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +1042 ___ Python tracker ___ ___

[issue27025] More human readable generated widget names

2016-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Good point about "@". I missed this. Thanks Terry. "!" LGTM. Committed to 3.6 too. I consider this as the fix of the bug in 3.6 feature. -- resolution: -> fixed status: open -> closed versions: +Python 3.7 ___

[issue27025] More human readable generated widget names

2016-10-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 603ac788ed27 by Serhiy Storchaka in branch '3.6': Issue #27025: Generated names for Tkinter widgets now start by the "!" prefix https://hg.python.org/cpython/rev/603ac788ed27 New changeset 505949cb2692 by Serhiy Storchaka in branch 'default': Issue

[issue27025] More human readable generated widget names

2016-10-24 Thread Terry J. Reedy
Terry J. Reedy added the comment: Agreed that ` is not best and should be changed. An alternative should be in next release. I looked back at the output in msg268406. ! is similar to | but shorter, and better for that. It is also, generally, thicker, which is better. With the font used on

[issue27025] More human readable generated widget names

2016-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Now it is clear that '`' is bad prefix. There are 32 non-alphanumerical non-control ASCII characters: '!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}',

[issue27025] More human readable generated widget names

2016-06-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm working on a patch that allows to trace all Tcl commands passed from Tkinter, and a number of ".`" in widget names looks not nice. -- ___ Python tracker

[issue27025] More human readable generated widget names

2016-06-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Worse yet, SO replaces a single ` with a space, so that ".`label" is displayed as ". label" -- ___ Python tracker ___

[issue27025] More human readable generated widget names

2016-06-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: The change is a super great idea (see below), but I now think (my suggestion of) '`' is a bad idea because it conflicts with the use of '`' as markup for code and output, as in rst and stackoverflow.

[issue27025] More human readable generated widget names

2016-06-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 304c61263ae6 by Serhiy Storchaka in branch 'default': Issue #27025: Generated names for Tkinter widgets are now more meanful https://hg.python.org/cpython/rev/304c61263ae6 -- nosy: +python-dev ___ Python

[issue27025] More human readable generated widget names

2016-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: ` and ^ LGTM. We can change this in any time if it looks bad. -- assignee: -> serhiy.storchaka ___ Python tracker

[issue27025] More human readable generated widget names

2016-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I apologize for my mistake, but it is not of much relevance. My preference is based on my subjective reactions on reading both variations. I used tknames.py, which outputs < 20 names, rather than the code that output > 200 names, because the former seems more

[issue27025] More human readable generated widget names

2016-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Generated names are in lower case. -- ___ Python tracker ___ ___

[issue27025] More human readable generated widget names

2016-06-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I based my opinion on trying to actually read and understand the output of tknames.py, with your patch done both ways, in a way that I would do in use. Since class names always begin with upper case, it did not occur to me to read '1' as anything other than

[issue27025] More human readable generated widget names

2016-06-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "1" looks too similar to "l". -- ___ Python tracker ___ ___

[issue27025] More human readable generated widget names

2016-06-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with back-compatibility, suppression of '1' suffix, and numbering, which makes suppressed '1' common. I prefer '1' rather that '0' prefix. Visually, '1' leaves more space between digit and word. Semantically, each component represents 1 of

[issue27025] More human readable generated widget names

2016-06-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated. 1. The prefix "0" is used for generated names. This keeps the old rule (generated names start from a digit and are not valid Python identifier) and looks less striking than "_". 2. Lowercased Python class name is used as a base name for

[issue27025] More human readable generated widget names

2016-06-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: While a widget tree could be constructed using tk's introspection functions, I believe there are other good uses for monkey patching. The attached .py file defines a monkeypatch context manager (does one exist already?). The file uses the c.m. twice to

[issue27025] More human readable generated widget names

2016-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have experimented with different naming schemes. Original output with Terry's example (actually names are longer in IDLE, since the configuration dialog is created as a child of other toplevel widget): label

[issue27025] More human readable generated widget names

2016-06-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 I think would be a nice improvement. -- nosy: +rhettinger ___ Python tracker ___

[issue27025] More human readable generated widget names

2016-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Try this instead. import tkinter as tk from idlelib.configdialog import ConfigDialog from idlelib import macosx _realsetup = tk.BaseWidget._setup def _wrapsetup(self, master, cnf): _realsetup(self, master, cnf) print(self.widgetName, self._w)

[issue27025] More human readable generated widget names

2016-06-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: To make the experiment easy to repeat, say after the patch, I wrote this. (Perhaps inspired by Ned Batchelder's 'machete debugging' PyCon talk.) import tkinter as tk from idlelib.configdialog import ConfigDialog _realsetup = tk.BaseWidget._setup def

[issue27025] More human readable generated widget names

2016-06-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can apply show_widget_names.diff to see all widget names. Run IDLE and open the configuration dialog for example. -- Added file: http://bugs.python.org/file43092/show_widget_names.diff ___ Python tracker

[issue27025] More human readable generated widget names

2016-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ah, the patch makes it clear. Tkinter is already generating a name to submit to tk, and you are proposing to replace using the Python id for that purpose. +1. I also notice that duplicate names cause the old tk widget to be destroyed even if the Python

[issue27025] More human readable generated widget names

2016-05-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > The 'virtue' of the digit strings names is that they match tk behavior (I > presume) and are consistently opaque ;-) No, in Tk you have to give names for all widgets. frame .main button .main.ok This is similar to how classes or functions are declared in

[issue27025] More human readable generated widget names

2016-05-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: First thoughts on the proposal. I overall like it. The 'virtue' of the digit strings names is that they match tk behavior (I presume) and are consistently opaque ;-) *Someone* will object to change. Is your proposal to have (_)tkinter add a name= option

[issue27025] More human readable generated widget names

2016-05-15 Thread Serhiy Storchaka
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