On Tue, Nov 9, 2010 at 2:58 AM, Jean-Daniel jeandaniel.bro...@gmail.com wrote:
Ok,
If I attach an item_type to the the list, I do not think I will able to use
the native Python list, and should use a subclass instead. It is a bit
heavyweight, especially when the intent of the use of the
What exactly are you hoping to accomplish?
In brief, I wish there were a concise and clear way to express that an
object implements a list of generator functions, in the context of CS
students learning the concept of interface.
I am writing an article on a sudoku solver for an audience of CS
The end of the last message was not finished...
Ideally, here is (maybe) what I wish I could write:
from zope.interface import IList, IGenerator, implements, requires
def make_generator_functions():
implements(IList(IGenerator))
[...]
def stack_assumption(gen_funcs):
Hello,
I have two objects which interoperate to solve a sudoku: the Sudoku class
and a vector (a list actually) of generator functions. The Sudoku interface
is simple to write as it requires three functions and an attribute.
class ISudoku:
board = Attribute()
def free(col, line):
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 11/08/2010 04:40 AM, Jean-Daniel wrote:
Hello,
I have two objects which interoperate to solve a sudoku: the Sudoku class
and a vector (a list actually) of generator functions. The Sudoku interface
is simple to write as it requires three
Ok,
If I attach an item_type to the the list, I do not think I will able to use
the native Python list, and should use a subclass instead. It is a bit
heavyweight, especially when the intent of the use of the interface was
documentation.
List and generators are very common in Python and are