Python recipes: list mixin, improved timeit, etc

2005-10-07 Thread barnesc
So mixins are just a sub-class [pun intended] of sub-classing? I've just found this: [quote] A mixin class is a parent class that is inherited from - but not as a means of specialization. Typically, the mixin will export services to a child class, but no semantics will be implied about the

Python recipes: list mixin, improved timeit, etc

2005-10-06 Thread barnesc
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

Builtin classes list, set, dict reimplemented via B-trees

2005-09-15 Thread barnesc
Nifty, Tim Peters responded to my e-mail. I must've said something interesting. Cool, a PyCelebrity! [barnesc at engr.orst.edu] ... I've gotten bored and went back to one of my other projects: reimplementing the Python builtin classes list(), set(), dict(), and frozenset() with balanced

Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread barnesc
Hi again, Since my linear algebra library appears not to serve any practical need (I found cgkit, and that works better for me), I've gotten bored and went back to one of my other projects: reimplementing the Python builtin classes list(), set(), dict(), and frozenset() with balanced trees

Builtin classes list, set, dict reimplemented via B-trees

2005-09-14 Thread barnesc
barnesc at engr.orst.edu wrote: So my question is: are there any other *practical* applications of a B-tree based list/set/dict ? In other words, is this module totally worth coding, or is it just academic wankery and theoretical flim flam ? :) B-trees are specifically designed for disk

Python linear algebra module -- requesting comments on interface

2005-09-09 Thread barnesc
interface is: http://oregonstate.edu/~barnesc/temp/linalg/ Is this going to become free software. If yes, what license will you use? So my suggestions: In cases like these ones: random_matrix(m, n=-1) zero_matrix(m, n=-1) .. I think it's better to set the default value to None