Message184494
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. |
|
Date |
User |
Action |
Args |
2013-03-18 19:05:27 | klappnase | set | recipients:
+ klappnase, gpolo, serhiy.storchaka |
2013-03-18 19:05:27 | klappnase | set | messageid: <1363633527.93.0.788483472049.issue17397@psf.upfronthosting.co.za> |
2013-03-18 19:05:27 | klappnase | link | issue17397 messages |
2013-03-18 19:05:27 | klappnase | create | |
|