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
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
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
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
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.
Thank you so much!!! It works perfectly!!!
;)
--
http://mail.python.org/mailman/listinfo/python-list
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
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