updade from Atlas repo

This commit is contained in:
Luciano Ramalho
2021-05-21 18:56:12 -03:00
parent c518bf851e
commit 8a330d822b
120 changed files with 2190 additions and 1184 deletions

View File

@@ -3,7 +3,7 @@ from typing import Any, Iterable, TYPE_CHECKING
from randompick import RandomPicker # <1>
class SimplePicker(): # <2>
class SimplePicker: # <2>
def __init__(self, items: Iterable) -> None:
self._items = list(items)
random.shuffle(self._items)

View File

@@ -1,4 +1,4 @@
from typing import Protocol, runtime_checkable, Any, Iterable
from typing import Protocol, runtime_checkable
from randompick import RandomPicker
@runtime_checkable # <1>

View File

@@ -1,9 +1,9 @@
import random
from typing import Any, Iterable, TYPE_CHECKING
from typing import Any, Iterable
from randompickload import LoadableRandomPicker
class SimplePicker():
class SimplePicker:
def __init__(self, items: Iterable) -> None:
self._items = list(items)
random.shuffle(self._items)
@@ -11,7 +11,7 @@ class SimplePicker():
def pick(self) -> Any:
return self._items.pop()
class LoadablePicker(): # <1>
class LoadablePicker: # <1>
def __init__(self, items: Iterable) -> None:
self.load(items)