Python recipes: list mixin, improved timeit, etc

barnesc at engr.orst.edu barnesc at engr.orst.edu
Fri Oct 7 00:03:33 EDT 2005


I added some recipes to the Python Cookbook:

 - listmixin

   Use ListMixin to create custom list classes from a small subset of
   list methods:

   http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440656

 - pytime

   Improves on timeit by allowing you to time a function directly
   (no need for confusing import and exec B.S.), and not requiring
   you to specify the number of iterations for the timing loop.

   http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440657

 - bitlist

   An example of listmixin: A memory compacted list of bits, uses
   1 byte per every 8 elements.

   http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440658


I hope you find these useful.

You can find more Python stuff by myself (and other misc thoughts) at
my blog (http://barnesc.blogspot.com/).

 - Connelly Barnes



More information about the Python-list mailing list