summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-04-03 20:42:43 (GMT)
committerGitHub <noreply@github.com>2021-04-03 20:42:43 (GMT)
commitcbfa09b70b745c9d7393c03955600f6d1cf019e3 (patch)
tree4637a1962c080861bc7e13d2c11dd19209a0c19a /Doc/howto
parentf12ae0b31a776c8906c428940f0c1bba48a75a45 (diff)
downloadcpython-cbfa09b70b745c9d7393c03955600f6d1cf019e3.zip
cpython-cbfa09b70b745c9d7393c03955600f6d1cf019e3.tar.gz
cpython-cbfa09b70b745c9d7393c03955600f6d1cf019e3.tar.bz2
Replace broken example code with correct simpler code. (GH-25162) (GH-25166)
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/descriptor.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
index 0ddf123..93dd354 100644
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -115,9 +115,9 @@ different, updated answers each time::
20
>>> g.size # The games directory has three files
3
- >>> open('games/newfile').close() # Add a fourth file to the directory
+ >>> os.remove('games/chess') # Delete a game
>>> g.size # File count is automatically updated
- 4
+ 2
Besides showing how descriptors can run computations, this example also
reveals the purpose of the parameters to :meth:`__get__`. The *self*