Improve tutorial entry on 'Lambda Forms'. (issue 18646)
http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst File Doc/tutorial/controlflow.rst (right): http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:586: Lambda Forms "forms" could be changed here as well. http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:589: Small anonymous functions can be created with the :keyword:`lambda` keyword. I prefer "simple", rather than "small". http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:590: This function returns the sum of its two arguments: ``lambda a, b: a+b``. "For example, this function..."? http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:591: Lambda forms can be used wherever function objects are required. They are I would get rid of "forms" here too. http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:592: syntactically restricted to a single expression. Semantically, they are just Do we have an explanation of what an "expression" is somewhere? http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:594: name attribute will always be '<lambda>'. Like nested function Is this the only difference? Maybe you could say: "... a normal function definition, except that their name attribute will always be '<lambda>'." (Also there's a missing space after the period.) http://bugs.python.org/review/18646/diff/8811/Doc/tutorial/controlflow.rst#n... Doc/tutorial/controlflow.rst:612: [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')] I think this example would make more sense if the elements of the tuples were swapped. A normal sort would sort them alphabetically, but with the lambda you can sort the tuples correctly. I would also put this example before the make_incrementor one, since this usage is more common. http://bugs.python.org/review/18646/
participants (1)
-
ezio.melotti@gmail.com