Skip to content

Commit d6de2ff

Browse files
committed
fix: type urandom choice helper for mypy
1 parent f68b64c commit d6de2ff

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/phasmid/dummy_generator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import string
2020
from dataclasses import dataclass, field
2121
from pathlib import Path
22-
from typing import Sequence
22+
from typing import Sequence, TypeVar
2323

2424
from .context_profile import (
2525
ContextProfile,
@@ -83,7 +83,10 @@ class GeneratedDummyReport:
8383
]
8484

8585

86-
def _urandom_choice(items: Sequence) -> object:
86+
T = TypeVar("T")
87+
88+
89+
def _urandom_choice(items: Sequence[T]) -> T:
8790
"""Pick a uniformly random item using os.urandom."""
8891
if not items:
8992
raise ValueError("cannot choose from empty sequence")

0 commit comments

Comments
 (0)