Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

January 16, 2002

Quality Code

Here is some quality code Alex Martelli posted on comp.lang.python;

class fifo:
    def __init__(self): = []
        self.first = 0
    def head(self):
    def pop(self):
        self.first += 1
        if self.first > len(
            self.first = 0
    def append(self, value):

I'm posting it here as a mental note to myself to use this class whenever I need a first in, first out stack.

Posted by Andy Todd at January 16, 2002 09:31 AM