bytebuf-3-bytarray_map.py 236 B

12345678910
  1. # Doing some operation on bytearray
  2. # No joins, but still map().
  3. import bench
  4. def test(num):
  5. for i in iter(range(num//10000)):
  6. ba = bytearray(b"\0" * 1000)
  7. ba2 = bytearray(map(lambda x: x + 1, ba))
  8. bench.run(test)