diff options
Diffstat (limited to 'Lib/types.py')
-rw-r--r-- | Lib/types.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/types.py b/Lib/types.py index ce4652f371..53b588da75 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -15,6 +15,13 @@ CodeType = type(_f.__code__) MappingProxyType = type(type.__dict__) SimpleNamespace = type(sys.implementation) +def _cell_factory(): + a = 1 + def f(): + nonlocal a + return f.__closure__[0] +CellType = type(_cell_factory()) + def _g(): yield 1 GeneratorType = type(_g()) |