On 29 Sep., 03:55, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Simon Forman" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> | class FakeQueue(list):
> |put = list.append
> |get = lambda self: self.pop(0)
>
> Sorry, to me this is a foolish use of lambda as it is exactly th
"Simon Forman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| class FakeQueue(list):
|put = list.append
|get = lambda self: self.pop(0)
Sorry, to me this is a foolish use of lambda as it is exactly the same as
def get(self): self.pop(0)
except that in the latter, the r
Simon Forman <[EMAIL PROTECTED]> writes:
> class FakeQueue(list):
> put = list.append
> get = lambda self: self.pop(0)
from collections import deque
class FakeQueue(deque):
put = deque.append
get = deque.popleft
--
http://mail.python.org/mailman/listinfo/python-list
class FakeQueue(list):
put = list.append
get = lambda self: self.pop(0)
;]
--
http://mail.python.org/mailman/listinfo/python-list