This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients serhiy.storchaka, terry.reedy
Date 2016-07-01.21:20:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1467408001.61.0.890613536483.issue27405@psf.upfronthosting.co.za>
In-reply-to
Content
In "debug = False+1', I presume the '+1' is just temporary.

The debug property and the clinic file refer to _tkinter.tkapp.get/settrace, which do not exist.  Did you just forget to include that part?  Or does 'preliminary' mean 'do not test yet'?

>>> import tkinter
>>> tkinter.debug
1
>>> import idlelib.idle
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\Python\dev\36\lib\idlelib\idle.py", line 11, in <module>
    idlelib.pyshell.main()
  File "F:\Python\dev\36\lib\idlelib\pyshell.py", line 1553, in main
    root = Tk(className="Idle")
  File "F:\Python\dev\36\lib\tkinter\__init__.py", line 2018, in __init__
    self.debug = debug
  File "F:\Python\dev\36\lib\tkinter\__init__.py", line 2110, in debug
    self.tk.settrace(trace)
AttributeError: '_tkinter.tkapp' object has no attribute 'settrace'

At least the error shows that the code works as far as written ;-).

I now understand 'larger customization ...' to mean supplying a trace function other than the default, to do something with 'cmd' other than just print it.  For instance, one could record tcl commands in a file and later count the tcl function calls, much like python's trace does.  To do that, I believe you could just replace 'def trace ... with

if iscallable(value):
    trace = value
else:
    def trace ...

+1 on adding this.  The default trace would be useful for simple interaction, but less so for what I tried to do above, which is to trace a complete IDLE session.
History
Date User Action Args
2016-07-01 21:20:01terry.reedysetrecipients: + terry.reedy, serhiy.storchaka
2016-07-01 21:20:01terry.reedysetmessageid: <1467408001.61.0.890613536483.issue27405@psf.upfronthosting.co.za>
2016-07-01 21:20:01terry.reedylinkissue27405 messages
2016-07-01 21:20:01terry.reedycreate