We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83f0963 commit de1e5ffCopy full SHA for de1e5ff
src/sonyflake_turbo/_sonyflake.pyi
@@ -1,3 +1,4 @@
1
+from collections.abc import Iterator
2
from typing import overload
3
4
try:
@@ -13,7 +14,7 @@ SONYFLAKE_MACHINE_ID_MAX: int
13
14
SONYFLAKE_MACHINE_ID_OFFSET: int
15
SONYFLAKE_TIME_OFFSET: int
16
-class SonyFlake:
17
+class SonyFlake(Iterator[int]):
18
def __init__(self, *machine_id: int, start_time: int | None = None):
19
"""Initialize SonyFlake ID generator.
20
@@ -63,7 +64,7 @@ class SonyFlake:
63
64
@overload
65
def _raw(self, n: None) -> tuple[int, float]: ...
66
-class MachineIDLCG:
67
+class MachineIDLCG(Iterator[int]):
68
"""A simple LCG producing ints suitable to be used as ``machine_id``.
69
70
Intended to be used in examples, tests, or when concurrency is not an issue.
0 commit comments