MCPcopy Index your code
hub / github.com/secdev/scapy / RandChoice

Class RandChoice

scapy/volatile.py:481–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479
480
481class RandChoice(RandField[Any]):
482 def __init__(self, *args):
483 # type: (*Any) -> None
484 if not args:
485 raise TypeError("RandChoice needs at least one choice")
486 self._choice = list(args)
487
488 def _command_args(self):
489 # type: () -> str
490 return ", ".join(self._choice)
491
492 def _fix(self):
493 # type: () -> Any
494 return random.choice(self._choice)
495
496
497_S = TypeVar("_S", bytes, str)

Callers 3

randvalMethod · 0.90
randvalMethod · 0.90
_fixMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected