Replace broken example code with correct simpler code. (GH-25162) (GH-25166)
https://github.com/python/cpython/commit/cbfa09b70b745c9d7393c03955600f6d1cf... commit: cbfa09b70b745c9d7393c03955600f6d1cf019e3 branch: 3.9 author: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> committer: rhettinger <rhettinger@users.noreply.github.com> date: 2021-04-03T13:42:43-07:00 summary: Replace broken example code with correct simpler code. (GH-25162) (GH-25166) files: M Doc/howto/descriptor.rst diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst index 0ddf1239ed298..93dd35441f41c 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*
participants (1)
-
rhettinger