We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f68b64c commit d6de2ffCopy full SHA for d6de2ff
1 file changed
src/phasmid/dummy_generator.py
@@ -19,7 +19,7 @@
19
import string
20
from dataclasses import dataclass, field
21
from pathlib import Path
22
-from typing import Sequence
+from typing import Sequence, TypeVar
23
24
from .context_profile import (
25
ContextProfile,
@@ -83,7 +83,10 @@ class GeneratedDummyReport:
83
]
84
85
86
-def _urandom_choice(items: Sequence) -> object:
+T = TypeVar("T")
87
+
88
89
+def _urandom_choice(items: Sequence[T]) -> T:
90
"""Pick a uniformly random item using os.urandom."""
91
if not items:
92
raise ValueError("cannot choose from empty sequence")
0 commit comments