1. 05 Sep, 2017 4 commits
    • Neil Schemenauer's avatar
    • Neil Schemenauer's avatar
      bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#1908) · e38d12ed
      Neil Schemenauer authored
      * Maintain a list of BufferedWriter objects.  Flush them on exit.
      
      In Python 3, the buffer and the underlying file object are separate
      and so the order in which objects are finalized matters.  This is
      unlike Python 2 where the file and buffer were a single object and
      finalization was done for both at the same time.  In Python 3, if
      the file is finalized and closed before the buffer then the data in
      the buffer is lost.
      
      This change adds a doubly linked list of open file buffers.  An atexit
      hook ensures they are flushed before proceeding with interpreter
      shutdown.  This is addition does not remove the need to properly close
      files as there are other reasons why buffered data could get lost during
      finalization.
      
      Initial patch by Armin Rigo.
      
      * Use weakref.WeakSet instead of WeakKeyDictionary.
      
      * Simplify buffered double-linked list types.
      
      * In _flush_all_writers(), suppress errors from flush().
      
      * Remove NEWS entry, use blurb.
      e38d12ed
    • Raymond Hettinger's avatar
      Fix terminology in comment and add more design rationale. (#3335) · 64263dfd
      Raymond Hettinger authored
      * Fix terminology in comment and add more design rationale.
      
      * Fix extra space
      64263dfd
    • Raymond Hettinger's avatar
      Add comment to explain the implications of not sorting keywords (#3331) · 55037095
      Raymond Hettinger authored
      In Python 3.6, sorted() was removed from _make_key() for the lru_cache and instead rely on guaranteed keyword argument order preservation.  This makes keyword argument handling faster but it also causes multiple callers with a different keyword argument order to be cached as separate items.  Depending on your point of view, this is either a performance regression (increased number of cache misses) or a performance enhancement (faster computation of keys).
      55037095
  2. 04 Sep, 2017 28 commits
  3. 03 Sep, 2017 4 commits
  4. 01 Sep, 2017 4 commits