updade from Atlas repo
This commit is contained in:
@@ -53,4 +53,4 @@ def test_double_nparray() -> None:
|
||||
def test_double_none() -> None:
|
||||
given = None
|
||||
with pytest.raises(TypeError):
|
||||
result = double(given)
|
||||
double(given)
|
||||
|
||||
@@ -19,7 +19,6 @@ class Tombola(abc.ABC): # <1>
|
||||
"""Return `True` if there's at least 1 item, `False` otherwise."""
|
||||
return bool(self.inspect()) # <5>
|
||||
|
||||
|
||||
def inspect(self):
|
||||
"""Return a sorted tuple with the items currently inside."""
|
||||
items = []
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user