Well, Bill Mill and I simultaneously and independently decided to write
a preprocessor to strip out the unfortunate "@" decorator syntax. I
think we were both aiming at a polemic purpose rather than a practical
one, but as time fades it seems less clear what we were simultaneously
inspired to achie
Yes, I definitely should have done that for that case. I'm not
entirely sure why I didn't. If I had, though, I may not have been
prompted to ask the question and get all the other great little
tidbits!
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Russell Warren <[EMAIL PROTECTED]> wrote:
.
.
.
>Anyway - it worked... you've answered my question perfectly, thanks. I
>hadn't considered that the module loading phase could basically used
>for
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()
> D
Thanks guys - all great responses that answered my question in a few
different ways with the addition of some other useful tidbits!
This is a nice summary:
> In general the idea is to move the test from 'every time I need to do
> something' to 'once when some name is defined'.
Gotta love the resp
> 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()
DoSomethingSimple()
return ret
And se
Russell Warren wrote:
> After some digging it seems that python does not have any equivalent to
> C's #if directives, and I don't get it...
>
> For example, I've got a bit of python 2.3 code that uses
> collections.deque.pop(0) in order to pop the leftmost item. In python
> 2.4 this is no longer
Russell Warren wrote:
> After some digging it seems that python does not have any equivalent to
> C's #if directives, and I don't get it...
>
> For example, I've got a bit of python 2.3 code that uses
> collections.deque.pop(0) in order to pop the leftmost item. In python
> 2.4 this is no longer
Russell Warren wrote:
> For example, I've got a bit of python 2.3 code that uses
> collections.deque.pop(0) in order to pop the leftmost item. In python
> 2.4 this is no longer valid - there is no argument on pop (rightmost
> only now) and you call .popleft() instead.
the collections module was
After some digging it seems that python does not have any equivalent to
C's #if directives, and I don't get it...
For example, I've got a bit of python 2.3 code that uses
collections.deque.pop(0) in order to pop the leftmost item. In python
2.4 this is no longer valid - there is no argument on po
10 matches
Mail list logo