Skip to content

Commit 69cbec4

Browse files
committed
tests/bench: Add testcase for positional/kwargs to enumerate().
Inspired by discussion in adafruit#577. So, in this case of builtin function, passing args by keyword has less than 1% overhead.
1 parent 2a05f05 commit 69cbec4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import bench
2+
3+
def test(num):
4+
for i in iter(range(num//20)):
5+
enumerate([1, 2], 1)
6+
7+
bench.run(test)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import bench
2+
3+
def test(num):
4+
for i in iter(range(num//20)):
5+
enumerate(iterable=[1, 2], start=1)
6+
7+
bench.run(test)

0 commit comments

Comments
 (0)