1. 13 Feb, 2017 4 commits
  2. 12 Feb, 2017 7 commits
  3. 11 Feb, 2017 5 commits
  4. 10 Feb, 2017 21 commits
  5. 09 Feb, 2017 3 commits
    • Victor Stinner's avatar
      Issue #29507: Fix _PyObject_CallFunctionVa() · fe4ff830
      Victor Stinner authored
      is_size_t test was reversed. Bug spotted by INADA Naoki.
      fe4ff830
    • Victor Stinner's avatar
      Issue #29507: Update test_exceptions · 331bbe6a
      Victor Stinner authored
      test_unraisable() of test_exceptions expects that PyErr_WriteUnraisable(method)
      fails on repr(method).
      
      Before the previous change (7b8df4a5d81d), slot_tp_finalize() called
      PyErr_WriteUnraisable() with a PyMethodObject. In this case, repr(method) calls
      repr(self) which is BrokenRepr.__repr__() and the calls raises a new exception.
      
      After the previous change, slot_tp_finalize() uses an unbound method: repr() is
      called on a regular __del__() method which doesn't call repr(self). repr()
      doesn't fail anymore.
      
      PyErr_WriteUnraisable() doesn't call __repr__() anymore, so remove BrokenRepr
      unit test.
      331bbe6a
    • Victor Stinner's avatar
      Optimize slots: avoid temporary PyMethodObject · 516b9816
      Victor Stinner authored
      Issue #29507: Optimize slots calling Python methods. For Python methods, get
      the unbound Python function and prepend arguments with self, rather than
      calling the descriptor which creates a temporary PyMethodObject.
      
      Add a new _PyObject_FastCall_Prepend() function used to call the unbound Python
      method with self. It avoids the creation of a temporary tuple to pass
      positional arguments.
      
      Avoiding temporary PyMethodObject and avoiding temporary tuple makes Python
      slots up to 1.46x faster. Microbenchmark on a __getitem__() method implemented
      in Python:
      
      Median +- std dev: 121 ns +- 5 ns -> 82.8 ns +- 1.0 ns: 1.46x faster (-31%)
      Co-Authored-by: default avatarINADA Naoki <songofacandy@gmail.com>
      516b9816