Kushal Das

FOSS and life. Kushal Das talks here.

Python development on 2nd October

logging.config.listen() in Lib/logging/config.py, 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 http://docs.python.org/dev/library/timeit.html 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/test_format.py is also updated to have new tests for the changes.

Updated code to use “yield from” in various places - Lib/http/cookiejar.py - Lib/json/encoder.py - Lib/xml/etree/ElementPath.py - Lib/xml/etree/ElementTree.py - Tools/importbench/importbench.py

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/test_threaded_import.py 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/bz2.py

Anotjher patch set to utilize yeild from in the codebase. - Lib/argparse.py - Lib/argparse.py - Lib/concurrent/futures/_base.py - Lib/difflib.py - Lib/email/_header_value_parser.py - Lib/email/iterators.py - Lib/glob.py - Lib/mailbox.py - Lib/pkgutil.py - Lib/traceback.py - Lib/weakref.py

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

comments powered by Disqus