> Let me make sure I understand.  Let's imagine that we have such a
> CircularQueue, with methods:
> 
>    push(element)
>    pop()
>    isEmpty()
> 
> [example unittest code]

Danny,

Yes, it looks like that is a valid unittest for a circular buffer.  An
enhancement is to modify the accessors:

   push(element) --> push(sequence) 
   pop() --> pop(N)

If pushing caused an overwrite, the consumer could be notified,
perhaps by an overwrite exception.

Marcus
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to