https://github.com/python/cpython/commit/075cabb02650e786008e45b632816c6a723801b0 commit: 075cabb02650e786008e45b632816c6a723801b0 branch: 3.14 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: picnixz <10796600+picn...@users.noreply.github.com> date: 2025-05-17T08:05:47Z summary:
[3.14] gh-133881: add forward reference to `list.sort()` in lambda expression tutorial (GH-133910) (#134126) gh-133881: add forward reference to `list.sort()` in lambda expression tutorial (GH-133910) (cherry picked from commit c1c9ad1d5a62a591eb2f0f0d29f3fa02e0949f14) Co-authored-by: Oleg Burnaev <51371645+shepard2...@users.noreply.github.com> files: M Doc/tutorial/controlflow.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 95939242fb7d44..9a810f16388b9d 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -999,7 +999,8 @@ scope:: 43 The above example uses a lambda expression to return a function. Another use -is to pass a small function as an argument:: +is to pass a small function as an argument. For instance, :meth:`list.sort` +takes a sorting key function *key* which can be a lambda function:: >>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')] >>> pairs.sort(key=lambda pair: pair[1]) _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com