Skip to content

Commit 3ae8885

Browse files
authored
docs: note about singledispatch (#28)
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
1 parent b3b74ee commit 3ae8885

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/zeroth/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
"""Copyright (c) 2024 Nathaniel Starkman. All rights reserved.
22
33
zeroth: Efficiently get the index-0 element of an iterable.
4+
5+
Notes
6+
-----
7+
- 2025/10: tested using single-dispatch generic function, but it was slower.
8+
Currently it's 60.7 ns ± 0.303 ns per loop for `zeroth(list(range(10)))`.
9+
Using singledispatch was 232 ns ± 3.44 ns per loop.
10+
411
"""
512

613
__all__ = ["zeroth"]

0 commit comments

Comments
 (0)