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

25
interfaces/tombola.py Normal file
View File

@@ -0,0 +1,25 @@
from abc import ABCMeta, abstractmethod
class Tombola(metaclass=ABCMeta): # <1>
@abstractmethod
def __init__(self, iterable): # <2>
raise NotImplementedError
@abstractmethod
def load(self):
raise NotImplementedError
@abstractmethod
def pop(self):
raise NotImplementedError
def loaded(self): # <3>
try:
item = self.pop()
except LookupError:
return False
else:
self.load([item]) # put it back
return True