Re: [Tutor] stack class

2008-07-11 Thread Reed O'Brien
On Jul 11, 2008, at 7:54 PM, Christopher Spears wrote: For another Core Python Programming question, I created a stack class. I then put the class into a script to test it: I understand that this is an exercise; but I think it might be interesting for you to also look at collections.deque

Re: [Tutor] stack class

2008-07-11 Thread Alan Gauld
"Christopher Spears" <[EMAIL PROTECTED]> wrote I created a stack class. I then put the class into a script to test it: I'll assume the crazy indentation is due to email errors. class Stack(list): def isempty(self): length = len(self) if length == 0: return True else:

[Tutor] stack class

2008-07-11 Thread Christopher Spears
For another Core Python Programming question, I created a stack class. I then put the class into a script to test it: #!/usr/bin/python class Stack(list): def isempty(self): length = len(self) if length == 0: return True else: return False