New submission from Serhiy Storchaka: Proposed patch refactors code which converts the result of Tcl call to Python dict. Added new private function _splitdict() which does this in more robust manner.
Also this patch fixes a bug in Treeview.heading(). The heading subcommand of ttk::treeview return options dict in which one key surprisingly was not '-' prefixed. % ttk::treeview t % .t heading #0 -text {} -image {} -anchor center -command {} state {} Current code unconditionally cuts "s" from the "state" key. >>> from tkinter import ttk >>> t = ttk.Treeview() >>> t.heading('#0') {'anchor': 'center', 'tate': '', 'image': '', 'text': '', 'command': ''} ---------- assignee: serhiy.storchaka components: Tkinter files: tkinter_splitdict.diff keywords: patch messages: 225515 nosy: gpolo, serhiy.storchaka, terry.reedy priority: normal severity: normal stage: patch review status: open title: Refactor dict result handling in Tkinter type: behavior versions: Python 2.7, Python 3.4, Python 3.5 Added file: http://bugs.python.org/file36411/tkinter_splitdict.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22226> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com