klappnase added the comment: Yes, I happen to encounter these TclObjects occasionally, e.g. (not tested with the latest python):
$ python3 Python 3.1.3 (r313:86834, Nov 28 2010, 11:28:10) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from tkinter import * >>> from tkinter import ttk >>> r=Tk() >>> p=ttk.Progressbar(r) >>> p.cget('mode') <index object at 0x879d338> >>> print(p.cget('mode')) determinate >>> p.cget('mode') == 'determinate' False >>> str(p.cget('mode')) == 'determinate' True >>> In Python2 the easiest way to work around this imho is to set wantobjects to 0, however this does not seem to work in Python3 anymore, not sure if this is for some reason intentional or deserves another bug report: $ python3 Python 3.1.3 (r313:86834, Nov 28 2010, 11:28:10) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>> tkinter.wantobjects = 0 >>> from tkinter import ttk >>> r=tkinter.Tk() >>> p=ttk.Progressbar(r) >>> p.cget('mode') '' >>> To be honest, since these TclObjects never seem to work reliably I had preferred it a lot if they would have been turned off by default. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17397> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com