Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6475] Documentation > Tutorial > List Comprehensions

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 13, 2009, 7:57 AM

Post #1 of 5 (239 views)
Permalink
[issue6475] Documentation > Tutorial > List Comprehensions

New submission from Retro <vinetouu [at] gmail>:

There's a mistake in the code snippet:

>>> freshfruit = [' banana', ' loganberry ', 'passion fruit ']
>>> [weapon.strip() for weapon in freshfruit]
['banana', 'loganberry', 'passion fruit']


The second line should be:
>>> [fruit.strip() for fruit in freshfruit]
['banana', 'loganberry', 'passion fruit']


The old code snippet had weapons as items which many people didn't like,
so the code snippet was changed into a friendlier version. Please fix
this code snippet so that weapons are not involved here, even though the
code is not broken. Thank you.

----------
assignee: georg.brandl
components: Documentation
messages: 90486
nosy: Retro, georg.brandl
severity: normal
status: open
title: Documentation > Tutorial > List Comprehensions
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6475>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 13, 2009, 8:16 AM

Post #2 of 5 (232 views)
Permalink
[issue6475] Documentation > Tutorial > List Comprehensions [In reply to]

Ezio Melotti <ezio.melotti [at] gmail> added the comment:

That example was introduced in r16743 as:
>>> spcs = [" Apple", " Banana ", "Coco nut "]
>>> print [s.strip() for s in spcs]
['Apple', 'Banana', 'Coco nut']

and was changed in r16831 to:
>>> freshfruit = [' banana', ' loganberry ', 'passion fruit ']
>>> [weapon.strip() for weapon in freshfruit]
['banana', 'loganberry', 'passion fruit']

I think that the fresh fruits can really be considered as dangerous
weapons - especially the banana. <wink>

----------
nosy: +ezio.melotti
priority: -> low
resolution: -> rejected
status: open -> pending

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6475>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 13, 2009, 8:20 AM

Post #3 of 5 (221 views)
Permalink
[issue6475] Documentation > Tutorial > List Comprehensions [In reply to]

Mark Dickinson <dickinsm [at] gmail> added the comment:

> I think that the fresh fruits can really be considered as dangerous
> weapons.

Indeed. Google for "monty python self-defence against fresh fruit".

----------
nosy: +marketdickinson
status: pending -> open

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6475>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 13, 2009, 8:21 AM

Post #4 of 5 (226 views)
Permalink
[issue6475] Documentation > Tutorial > List Comprehensions [In reply to]

Changes by Mark Dickinson <dickinsm [at] gmail>:


----------
status: open -> pending

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6475>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 13, 2009, 2:59 PM

Post #5 of 5 (225 views)
Permalink
[issue6475] Documentation > Tutorial > List Comprehensions [In reply to]

Georg Brandl <georg [at] python> added the comment:

Retro, you still won't give up, will you?

----------
status: pending -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6475>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.