Re: Data Tree urgent help!!!!!!

2013-02-20 Thread Steven D'Aprano
Chris Angelico wrote: >> I'm wondering why you used map. >> >> >> apple, pear, dog, cat, fork, spoon = "apple pear dog cat fork >> spoon".split() > > Why, in case someone monkeypatched split() to return something other > than strings, of course! > > Sorry, I've been learning Ruby this week, and

Re: Data Tree urgent help!!!!!!

2013-02-20 Thread Chris Angelico
On Wed, Feb 20, 2013 at 10:01 PM, Steven D'Aprano wrote: > Leo Breebaart wrote: > >> Peter Otten <__pete...@web.de> writes: >> >>> >>> class Name(str): >>> ... def __repr__(self): >>> ... return self >>> ... >>> >>> apple, pear, dog, cat, fork, spoon = map(Name, "apple pear dog cat

Re: Data Tree urgent help!!!!!!

2013-02-20 Thread Steven D'Aprano
Leo Breebaart wrote: > Peter Otten <__pete...@web.de> writes: > >> >>> class Name(str): >> ... def __repr__(self): >> ... return self >> ... >> >>> apple, pear, dog, cat, fork, spoon = map(Name, "apple pear dog cat >> >>> fork spoon".split()) > > Is there any reason why you intro

Re: Data Tree urgent help!!!!!!

2013-02-20 Thread Peter Otten
Leo Breebaart wrote: > Peter Otten <__pete...@web.de> writes: > >> >>> class Name(str): >> ... def __repr__(self): >> ... return self >> ... >> >>> apple, pear, dog, cat, fork, spoon = map(Name, "apple pear dog cat >> >>> fork spoon".split()) > > Is there any reason why you intro

Re: Data Tree urgent help!!!!!!

2013-02-20 Thread Leo Breebaart
Peter Otten <__pete...@web.de> writes: > >>> class Name(str): > ... def __repr__(self): > ... return self > ... > >>> apple, pear, dog, cat, fork, spoon = map(Name, "apple pear dog cat fork > >>> spoon".split()) Is there any reason why you introduced the Name class? In Python 2.

Re: Data Tree urgent help!!!!!!

2013-02-19 Thread Ana DionĂ­sio
Thank you so much!!! It works perfectly!!! ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Data Tree urgent help!!!!!!

2013-02-19 Thread Peter Otten
anadionisio...@gmail.com wrote: > Hello! > I have this lists with information and I need to make a "tree" by > associating the information inside the lists. For example: > > l1 = [apple, pear] > l2 = [dog, cat] > l3 = [fork, spoon] > > And I need to make something like this: > > l4 = [apple, do

Data Tree urgent help!!!!!!

2013-02-19 Thread anadionisio257
Hello! I have this lists with information and I need to make a "tree" by associating the information inside the lists. For example: l1 = [apple, pear] l2 = [dog, cat] l3 = [fork, spoon] And I need to make something like this: l4 = [apple, dog, fork] l5 = [apple, dog, spoon] l6= [apple, cat, fo