[issue18646] Improve tutorial entry on 'Lambda Forms'.
New submission from Terry J. Reedy: [0. On mailing lists, 'lambda expression' is used rather than 'lambda form'. Docs use both. Consistency across docs is a broader issue than this one. So leave title alone for this one.] 1. (first sentence) "By popular demand, a few features commonly found in functional programming languages like Lisp have been added to Python." (in early Python 1!) I think this should just be deleted. See 4. below as a replacement. 2. " With the lambda keyword, small anonymous functions can be created." Change to "Small anonymous functions can be created with the lambda keyword." 3. change "Here’s a function that returns" to "This function returns" 3.5 add a sentence about the different between def and lambda (the name attribute. 4. Add sentences about the purposes of lambda. Add an example that illustrates passing functions.
pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')] pairs.sort(key=lambda pair: pair[1]) pairs [(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]
---------- assignee: docs@python components: Documentation files: tut-lambda.diff keywords: patch messages: 194296 nosy: docs@python, terry.reedy priority: normal severity: normal stage: patch review status: open title: Improve tutorial entry on 'Lambda Forms'. type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31142/tut-lambda.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- nosy: +ezio.melotti type: behavior -> enhancement _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
Roundup Robot added the comment: New changeset d4eb47c3d681 by Georg Brandl in branch '2.7': Closes #18646: improve lambda docs in tutorial. Original patch by Terry Reedy. http://hg.python.org/cpython/rev/d4eb47c3d681 ---------- nosy: +python-dev resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
Roundup Robot added the comment: New changeset ef1a17d5e263 by Georg Brandl in branch '3.3': Closes #18646: improve lambda docs in tutorial. Original patch by Terry Reedy. http://hg.python.org/cpython/rev/ef1a17d5e263 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
Georg Brandl added the comment: Thanks for the patch; I modified it a little (removed the sentence about the name attribute; this is too involved for the tutorial, and used "lambda expression"). Will fix more "lambda form" in the docs in another changeset. ---------- nosy: +georg.brandl resolution: fixed -> stage: committed/rejected -> patch review status: closed -> open _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
Raymond Hettinger added the comment: I think this was a nice improvement. ---------- nosy: +rhettinger _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
Changes by Georg Brandl <georg@python.org>: ---------- resolution: -> fixed status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue18646> _______________________________________
participants (5)
-
Ezio Melotti
-
Georg Brandl
-
Raymond Hettinger
-
Roundup Robot
-
Terry J. Reedy