From: Serhiy Storchaka Date: Sun, 26 Jun 2016 14:47:46 +0000 (+0300) Subject: Issue #22115: Updated Misc/NEWS. X-Git-Tag: v3.6.0a3~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b554faddf5d721d1d0039c57aae920f3156a5eb2;p=python Issue #22115: Updated Misc/NEWS. --- b554faddf5d721d1d0039c57aae920f3156a5eb2 diff --cc Lib/tkinter/test/test_tkinter/test_variables.py index c529259190,1f74453cea..44858173c4 --- a/Lib/tkinter/test/test_tkinter/test_variables.py +++ b/Lib/tkinter/test/test_tkinter/test_variables.py @@@ -87,9 -87,8 +87,9 @@@ class TestVariable(TestBase) v.set("value") self.assertTrue(v.side_effect) - def test_trace(self): + def test_trace_old(self): + # Old interface - v = Var(self.root) + v = Variable(self.root) vname = str(v) trace = [] def read_tracer(*args): @@@ -137,55 -136,6 +137,55 @@@ gc.collect() self.assertEqual(trace, [('write', vname, '', 'u')]) + def test_trace(self): - v = Var(self.root) ++ v = Variable(self.root) + vname = str(v) + trace = [] + def read_tracer(*args): + trace.append(('read',) + args) + def write_tracer(*args): + trace.append(('write',) + args) + tr1 = v.trace_add('read', read_tracer) + tr2 = v.trace_add(['write', 'unset'], write_tracer) + self.assertEqual(sorted(v.trace_info()), [ + (('read',), tr1), + (('write', 'unset'), tr2)]) + self.assertEqual(trace, []) + + v.set('spam') + self.assertEqual(trace, [('write', vname, '', 'write')]) + + trace = [] + v.get() + self.assertEqual(trace, [('read', vname, '', 'read')]) + + trace = [] + info = sorted(v.trace_info()) + v.trace_remove('write', tr1) # Wrong mode + self.assertEqual(sorted(v.trace_info()), info) + with self.assertRaises(TclError): + v.trace_remove('read', 'spam') # Wrong command name + self.assertEqual(sorted(v.trace_info()), info) + v.get() + self.assertEqual(trace, [('read', vname, '', 'read')]) + + trace = [] + v.trace_remove('read', tr1) + self.assertEqual(v.trace_info(), [(('write', 'unset'), tr2)]) + v.get() + self.assertEqual(trace, []) + + trace = [] + del write_tracer + gc.collect() + v.set('eggs') + self.assertEqual(trace, [('write', vname, '', 'write')]) + + trace = [] + del v + gc.collect() + self.assertEqual(trace, [('write', vname, '', 'unset')]) + class TestStringVar(TestBase): diff --cc Misc/NEWS index cd6aa9308d,cc53bcd7d8..1e61eca631 --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -10,28 -13,13 +10,30 @@@ What's New in Python 3.6.0 alpha Library ------- -- Issue #22115: Fixed tracing Tkinter variables: trace_vdelete() with wrong - mode no longer break tracing, trace_vinfo() now always returns a list of - pairs of strings, tracing in the "u" mode now works. +- Issue #22115: Added methods trace_add, trace_remove and trace_info in the + tkinter.Variable class. They replace old methods trace_variable, trace, + trace_vdelete and trace_vinfo that use obsolete Tcl commands and might - not work in future versions of Tcl. ++ not work in future versions of Tcl. Fixed old tracing methods: ++ trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now ++ always returns a list of pairs of strings, tracing in the "u" mode now works. + +- Issue #26243: Only the level argument to zlib.compress() is keyword argument + now. The first argument is positional-only. -- Fix a scoping issue in importlib.util.LazyLoader which triggered an - UnboundLocalError when lazy-loading a module that was already put into - sys.modules. +- Issue #27038: Expose the DirEntry type as os.DirEntry. Code patch by + Jelle Zijlstra. + +- Issue #27186: Update os.fspath()/PyOS_FSPath() to check the return value of + __fspath__() to be either str or bytes. + +- Issue #18726: All optional parameters of the dump(), dumps(), + load() and loads() functions and JSONEncoder and JSONDecoder class + constructors in the json module are now keyword-only. + +- Issue #27319: Methods selection_set(), selection_add(), selection_remove() + and selection_toggle() of ttk.TreeView now allow passing multiple items as + multiple arguments instead of passing them as a tuple. Deprecated + undocumented ability of calling the selection() method with arguments. - Issue #27079: Fixed curses.ascii functions isblank(), iscntrl() and ispunct().