Tim Peters wrote: > [Josiah Carlson] > >>There's been a python-based FIFO that is O(1) on {push, pop} and uses >>lists in the ASPN Python cookbook (adding len is easy): >>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/210459 >>You'd probably be more interested in the variant I posted as a >>comment; it is significantly faster when the output queue is >>exhausted. > > Yup! Yours is the nicest way to build an efficient (but thread-unsafe) > queue in Python. FWIW, if you're interested in fast stacks and queues you may want to have a look at mxStack and mxQueue from the egenix-mx-base distribution. They have nothing to do with threads (who needs them anyway when we have copy-on-write :-). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Jan 06 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4