summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorLisa Roach <lisaroach14@gmail.com>2017-06-08 11:43:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-06-08 11:43:26 (GMT)
commit64505a1f6c0af4574e17e823b27ffe24eca44df5 (patch)
treed2b40e19b44e4ab50f92440a54facc59038da4b3 /Doc
parent6cca5c8459cc439cb050010ffa762a03859d3051 (diff)
downloadcpython-64505a1f6c0af4574e17e823b27ffe24eca44df5.zip
cpython-64505a1f6c0af4574e17e823b27ffe24eca44df5.tar.gz
cpython-64505a1f6c0af4574e17e823b27ffe24eca44df5.tar.bz2
bpo-30486: Allow setting cell value (#1840)
The cell_contents attribute of the cell object is now writable.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/reference/datamodel.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 9708688..24a2618 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -510,6 +510,9 @@ Callable types
| :attr:`__closure__` | ``None`` or a tuple of cells | Read-only |
| | that contain bindings for the | |
| | function's free variables. | |
+ | | See below for information on | |
+ | | the ``cell_contents`` | |
+ | | attribute. | |
+-------------------------+-------------------------------+-----------+
| :attr:`__annotations__` | A dict containing annotations | Writable |
| | of parameters. The keys of | |
@@ -530,6 +533,9 @@ Callable types
implementation only supports function attributes on user-defined functions.
Function attributes on built-in functions may be supported in the future.*
+ A cell object has the attribute ``cell_contents``. This can be used to get
+ the value of the cell, as well as set the value.
+
Additional information about a function's definition can be retrieved from its
code object; see the description of internal types below.