From 7d7a28b038e29c47a28aa684813eccc1afa2f573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hadh=C3=A1zy=20Tam=C3=A1s?= Date: Mon, 14 Aug 2023 12:04:03 +0100 Subject: [PATCH 1/5] Extend functools docs. --- Doc/library/functools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 40f43f8b3519cd..f23109a784234c 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -226,7 +226,7 @@ The :mod:`functools` module defines the following functions: In general, the LRU cache should only be used when you want to reuse previously computed values. Accordingly, it doesn't make sense to cache - functions with side-effects, functions that need to create distinct mutable + functions with side-effects, generators and async functions that need to create distinct mutable objects on each call, or impure functions such as time() or random(). Example of an LRU cache for static web content:: From fb766b978b6e488ccf1ead3a5732e6ebc721cc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hadh=C3=A1zy=20Tam=C3=A1s?= <85063808+Hels15@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:57:44 +0100 Subject: [PATCH 2/5] Update Doc/library/functools.rst Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/library/functools.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index f23109a784234c..0c416b8367ea22 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -226,8 +226,9 @@ The :mod:`functools` module defines the following functions: In general, the LRU cache should only be used when you want to reuse previously computed values. Accordingly, it doesn't make sense to cache - functions with side-effects, generators and async functions that need to create distinct mutable - objects on each call, or impure functions such as time() or random(). + functions with side-effects, generators and async functions that + need to create distinct mutable objects on each call, + or impure functions such as time() or random(). Example of an LRU cache for static web content:: From 9fa1c460371fe43fc49d728a9d4009bfe7c41671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hadh=C3=A1zy=20Tam=C3=A1s?= <85063808+Hels15@users.noreply.github.com> Date: Mon, 14 Aug 2023 18:42:51 +0100 Subject: [PATCH 3/5] Update Doc/library/functools.rst Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- Doc/library/functools.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 0c416b8367ea22..f736eb0aca1ac5 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -226,8 +226,8 @@ The :mod:`functools` module defines the following functions: In general, the LRU cache should only be used when you want to reuse previously computed values. Accordingly, it doesn't make sense to cache - functions with side-effects, generators and async functions that - need to create distinct mutable objects on each call, + functions with side-effects, functions that need to create + distinct mutable objects on each call (such as generators and async functions), or impure functions such as time() or random(). Example of an LRU cache for static web content:: From e469fb145cb37ec3ffdee5039a8673f822d7da5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hadh=C3=A1zy=20Tam=C3=A1s?= Date: Tue, 15 Aug 2023 22:04:52 +0100 Subject: [PATCH 4/5] stdin/out can be filehandles -> add to docs. --- Doc/library/asyncio-eventloop.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 8f2d8f336c82bb..04af53b980ff9e 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -1442,6 +1442,7 @@ async/await code consider using the high-level * *stdin* can be any of these: * a file-like object + * an existing file descriptor (a positive integer), for example those created with :meth:`os.pipe()` * the :const:`subprocess.PIPE` constant (default) which will create a new pipe and connect it, * the value ``None`` which will make the subprocess inherit the file From 4cf0a9d79ea6569d604e3bcba6ce4d8e0844a7eb Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Sun, 20 Aug 2023 15:42:21 +0530 Subject: [PATCH 5/5] Update Doc/library/asyncio-eventloop.rst --- Doc/library/asyncio-eventloop.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 04af53b980ff9e..8f2d8f336c82bb 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -1442,7 +1442,6 @@ async/await code consider using the high-level * *stdin* can be any of these: * a file-like object - * an existing file descriptor (a positive integer), for example those created with :meth:`os.pipe()` * the :const:`subprocess.PIPE` constant (default) which will create a new pipe and connect it, * the value ``None`` which will make the subprocess inherit the file