Re: Tree library - multiple children

2013-12-13 Thread buchanae
I have this simple/stupid tree module:
https://github.com/abuchanan/bolts/blob/master/bolts/tree.py


On Thursday, December 12, 2013 10:14:34 AM UTC-8, Ricardo Aráoz wrote:
> I need to use a tree structure. Is there a good and known library?
> 
> Doesn't have to be binary tree, I need to have multiple children per node.
> 
> 
> 
> Thanks

-- 
https://mail.python.org/mailman/listinfo/python-list


Alternate initializer pattern?

2013-12-10 Thread buchanae
Hello.

I've been pondering an alternate initializer pattern that I've attempted to 
document here:

https://gist.github.com/abuchanan/7882317


Instead of using classmethod, I invent a new descriptor "alt_init" that creates 
an instance and passes it to the decorated function as the first argument 
(where classmethod would pass the class object).

I haven't used it in TheRealWord(tm), and maybe it's just a crappy Factory 
pattern (or is it Builder? or maybe Argile?), and I'm sure it has downsides, 
but I wanted to share anyway, to see what kind of feedback it would produce.

Thanks!
-- 
https://mail.python.org/mailman/listinfo/python-list