Python development on 2nd October

logging.config.listen() in Lib/logging/, doctstring updated with more description.

Issue #15452 Added verify option for logging configuration socket listener. Now we have a verify argument which should be a callable which should verify whether bytes received across the socket are valid and should be processed.

Issue #15609 Objects/unicodeobject.c Attached patch adds tests to check that str%args and str.format(args) take all optimization opportunities for simple format strings. It takes also the fast-path when Unicode string argument when width and/or precision is set. For example, “%.3s” % “abc” now returns “abc” unmodified (instead of creating a copy). The patch also takes the fast-path when formatting integers with str%args when the argument is not an int, but an object with int method.

Issue #15979 Documentation for the timeit module got updated.

Issue #15766 Python/dynload_shlib.c Catch exceptions while raising the ImportError in imp.load_dynamic()

Issue #15609 Optimize str%args for integer argument

  • Use _PyLong_FormatWriter() instead of formatlong() when possible, to avoid a temporary buffer
  • Enable the fast path when width is smaller or equals to the length, and when the precision is bigger or equals to the length
  • Add unit tests!
  • formatlong() uses PyUnicode_Resize() instead of _PyUnicode_FromASCII() to resize the output string

Code changed in this commit Objects/unicodeobject.c & Python/formatter_unicode.c Lib/test/ is also updated to have new tests for the changes.

Updated code to use “yield from” in various places - Lib/http/ - Lib/json/ - Lib/xml/etree/ - Lib/xml/etree/ - Tools/importbench/

Issue #16089 _elementtree.TreeBuilder broken with a non-C-deriving element_factory Patches went in with tests

Issue #15599 test_circular_imports() of test_threaded_import fails on FreeBSD 9.0 Lib/test/ Several systems cannot handle gil_interval == 1 in extreme situations. So it is now changed to sys.setswitchinterval(1e-5).

Issue #16304: Further optimize BZ2File.readlines?() In Lib/

Anotjher patch set to utilize yeild from in the codebase. - Lib/ - Lib/ - Lib/concurrent/futures/ - Lib/ - Lib/email/ - Lib/email/ - Lib/ - Lib/ - Lib/ - Lib/ - Lib/

In Lib/test/ we now have tests with subprocess.DEVNULL