bpo-30486: Allow setting cell value (#1840)

The cell_contents attribute of the cell object is now writable.
This commit is contained in:
Lisa Roach 2017-06-08 04:43:26 -07:00 committed by Serhiy Storchaka
parent 6cca5c8459
commit 64505a1f6c
4 changed files with 41 additions and 4 deletions

View file

@ -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.