[Checkins] [zopefoundation/BTrees] 4debe1: Use operator.index to avoid DeprecationWarning on ...

GitHub noreply at github.com
Fri Mar 9 16:24:17 CET 2018


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/BTrees
  Commit: 4debe1bbb158df09f198e40d4b8e676aa63faf27
      https://github.com/zopefoundation/BTrees/commit/4debe1bbb158df09f198e40d4b8e676aa63faf27
  Author: Jason Madden <jamadden at gmail.com>
  Date:   2018-03-09 (Fri, 09 Mar 2018)

  Changed paths:
    M BTrees/_base.py
    M CHANGES.rst

  Log Message:
  -----------
  Use operator.index to avoid DeprecationWarning on Python 2

Fixes #79

Slightly faster on CPython:

$ python -m perf timeit -s 'from struct import Struct; s = Struct("i"); unpack=s.unpack; pack=s.pack' 'unpack(pack(123456))'
.....................
Mean +- std dev: 252 ns +- 12 ns
$ python -m perf timeit -s 'from struct import Struct; s = Struct("i"); from operator import index; pack=s.pack' 'pack(index(123456))'
.....................
Mean +- std dev: 235 ns +- 6 ns

Very slightly faster on PyPy:

python -m perf timeit -s 'from struct import Struct; s = Struct("i"); unpack=s.unpack; pack=s.pack' 'unpack(pack(123456))'
.........
Mean +- std dev: 4.24 ns +- 0.12 ns
$ python -m perf timeit -s 'from struct import Struct; s = Struct("i"); from operator import index; pack=s.pack' 'pack(index(123456))'
.........
Mean +- std dev: 4.19 ns +- 0.10 ns


  Commit: ca8d390928c6d11485cb1c82bc5cf8fd7d456b6e
      https://github.com/zopefoundation/BTrees/commit/ca8d390928c6d11485cb1c82bc5cf8fd7d456b6e
  Author: Jason Madden <jason+github at nextthought.com>
  Date:   2018-03-09 (Fri, 09 Mar 2018)

  Changed paths:
    M BTrees/_base.py
    M CHANGES.rst

  Log Message:
  -----------
  Merge pull request #83 from zopefoundation/issue79

Use operator.index to avoid DeprecationWarning on Python 2


Compare: https://github.com/zopefoundation/BTrees/compare/023d96a7087f...ca8d390928c6


More information about the checkins mailing list