[Patches] [ python-Patches-797868 ] Tutorial, sec. 5.1.4 could contain an extra example

SourceForge.net noreply at sourceforge.net
Sat Aug 30 17:25:16 EDT 2003


Patches item #797868, was opened at 2003-08-30 13:27
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=797868&group_id=5470

Category: Documentation
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Michal Pasternak (mpasternak)
Assigned to: Nobody/Anonymous (nobody)
Summary: Tutorial, sec. 5.1.4 could contain an extra example

Initial Comment:
Section 5.1.4 of tutorial (List Comprehensions) could 
contain an extra example. I found it very useful and if it 
is correct (and compatible with python-programming 
philosophy) you could include it.




Example text follows:


"""


Another interesting functionality of list comprehensions is, 
that they can work just like map() for functions with 
many parameters:




  some_array = ["param1", "param2", "param3"]




  a = [foobar("constant", x, 12) for x in some_array]




"""




Please review it, and if it is correct, you should 
_definetley_ include this - just because it can be very 
useful, especially for people, who learn Python. After 
reading 5.1.4 section I didn't think I can do such things 
using list comprehensions... good, that those friendly 
people on #python explained it to me :)




Regards,


MP


----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-08-30 18:25

Message:
Logged In: YES 
user_id=80475

Good idea.  I've revised the patch example and text.  Applied 
as Doc/tut/tut.tex 1.202 and 1.196.8.5.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=797868&group_id=5470



More information about the Patches mailing list