Serhiy Storchaka added the comment:

> > <tkinter.Button object .3070343372.3066782348>
> 
> Not knowing the internal of tkinter, this seems somewhat confusing.
> Is that an "anonymous name/id"?

If the name parameter is not specified, repr(id(self)) is used. Here is a 
button with id() == 3066782348, its parent has id() == 3070343372 and its 
grandparent is root. str() for this button returns full name 
".3070343372.3066782348".

> > <tkinter.Button object .panel.b1>
> 
> This already looks more useful.  How is that determined?  Why the "first"
> object is missing (i.e. .panel seems to be an attribute of a missing
> object)?

Tk widgets are organized in hierarchical structure and names look similar to 
file system names. "." is the root, ".frame" is a frame in the root, 
".frame.b1" is a button in frame ".frame".

> Regarding the patch, are you sure that .__class__.__module__ is always
> available?  I seem to remember that it might be missing in some cases, e.g.
> modules written in C (but I might be confusing it with something else like
> __file__).

Yes, for example __module__ is absent in _tkinter.TkappType. But I think that 
every Python implemented class has __module__.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20636>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to