updated contents from Atlas repo

This commit is contained in:
Luciano Ramalho
2014-10-14 14:26:55 -03:00
parent 40688c038d
commit 981d5bc473
157 changed files with 71134 additions and 1 deletions

19
interfaces/tombolist.py Normal file
View File

@@ -0,0 +1,19 @@
from random import randrange
from tombola import Tombola
class TomboList(list): # <1>
def pop(self):
if self: # <2>
return super().pop(randrange(len(self))) # <3>
else:
raise LookupError('pop from empty TomboList')
def load(self, iterable): self.extend(iterable) # <4>
def loaded(self): return bool(self) # <5>
Tombola.register(TomboList) # <6>