Seems like I want a pre-processor, but...
invalidemail at aerojockey.com
Wed Mar 29 15:37:48 CEST 2006
Russell Warren wrote:
> > the collections module was added in 2.4
> Ah... sorry about that. I should have checked my example more closely.
> What I'm actually doing is rebinding some Queue.Queue behaviour in a
> "safe" location like this:
> def _get(self):
> ret = self.queue.popleft()
> return ret
What you should have done is call the base class's _get method, like
ret = Queue._get(self)
This'll work in 2.3, 2.4, and if they were to change the type of the
queue again in 2.5, it would still work without any changes. Don't
redo the work the base class does if you don't have to.
More information about the Python-list