bpo-35911: add cell constructor (GH-11771)
Add a cell constructor, expose the cell type in the types module.
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index b19aa02..07c3a2e 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -136,6 +136,14 @@
The type for code objects such as returned by :func:`compile`.
+.. data:: CellType
+
+ The type for cell objects: such objects are used as containers for
+ a function's free variables.
+
+ .. versionadded:: 3.8
+
+
.. data:: MethodType
The type of methods of user-defined class instances.
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst
index 83e1d23..9961aee 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -539,7 +539,9 @@
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.
+ code object; see the description of internal types below. The
+ :data:`cell <types.CellType>` type can be accessed in the :mod:`types`
+ module.
Instance methods
.. index::