question of style

Paul Rubin http
Sun Jul 5 18:53:34 EDT 2009


Simon Forman <sajmikins at gmail.com> writes:
> BTW, Paul, kind of a tangent: I reimplemented the same algorithm but
> using tuples instead of instances (and empty tuples for "NULL"
> values.)  I was trying to mess around in the space you seemed to
> indicate existed, i.e. a better implementation using other datatypes,
> but I didn't have a clear idea what I was doing and, as I said, I
> started by simply re-implementing with a different datatype.
> 
> Much to my surprise and delight, I discovered the tuple-based BTree
> was /already/ a "persistent data type"!  It was both awesome and a bit
> of an anti-climax. :]

Cool ;-).  It also seems to me a bit irregular to require every tree
to have a node with optional children, rather than allowing trees to be
compleely empty.  I think the irregularity complicated the code somewhat.



More information about the Python-list mailing list