complete draft: update from Atlas

This commit is contained in:
Luciano Ramalho
2021-06-09 00:13:02 -03:00
parent 08a4001b43
commit 135eca25d9
43 changed files with 4705 additions and 3240 deletions

View File

@@ -5,7 +5,7 @@ import random
from tombola import Tombola
class LotteryBlower(Tombola):
class LottoBlower(Tombola):
def __init__(self, iterable):
self._balls = list(iterable) # <1>
@@ -17,14 +17,14 @@ class LotteryBlower(Tombola):
try:
position = random.randrange(len(self._balls)) # <2>
except ValueError:
raise LookupError('pick from empty BingoCage')
raise LookupError('pick from empty LottoBlower')
return self._balls.pop(position) # <3>
def loaded(self): # <4>
return bool(self._balls)
def inspect(self): # <5>
return tuple(sorted(self._balls))
return tuple(self._balls)
# end::LOTTERY_BLOWER[]