diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-10-06 15:15:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-06 15:15:42 (GMT) |
commit | dcdeb96495fa105098544e2be7b74fa288589912 (patch) | |
tree | 658092d4192a892101eee6de303855470dbc612a /Doc/howto | |
parent | d15f47d1797292be7fe7f846f389bcd023a710d5 (diff) | |
download | cpython-dcdeb96495fa105098544e2be7b74fa288589912.zip cpython-dcdeb96495fa105098544e2be7b74fa288589912.tar.gz cpython-dcdeb96495fa105098544e2be7b74fa288589912.tar.bz2 |
bpo-34804: [doc] Rephrase section on side effects in functional.rst for clarity (GH-27989) (GH-28762)
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7af95a1e8097b2aab2cbe8de88727809e745b658)
Co-authored-by: DonnaDia <37962843+DonnaDia@users.noreply.github.com>
Diffstat (limited to 'Doc/howto')
-rw-r--r-- | Doc/howto/functional.rst | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Doc/howto/functional.rst b/Doc/howto/functional.rst index 74e8614..c7f8bc8 100644 --- a/Doc/howto/functional.rst +++ b/Doc/howto/functional.rst @@ -65,11 +65,10 @@ output must only depend on its input. Some languages are very strict about purity and don't even have assignment statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all -side effects. Printing to the screen or writing to a disk file are side -effects, for example. For example, in Python a call to the :func:`print` or -:func:`time.sleep` function both return no useful value; they're only called for -their side effects of sending some text to the screen or pausing execution for a -second. +side effects, such as printing to the screen or writing to a disk file. Another +example is a call to the :func:`print` or :func:`time.sleep` function, neither +of which returns a useful value. Both are called only for their side effects +of sending some text to the screen or pausing execution for a second. Python programs written in functional style usually won't go to the extreme of avoiding all I/O or all assignments; instead, they'll provide a |