mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-30486: Allow setting cell value (#1840)
The cell_contents attribute of the cell object is now writable.
This commit is contained in:
parent
6cca5c8459
commit
64505a1f6c
4 changed files with 41 additions and 4 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue