from __future__ import absolute_import
# cell dereferencing hack, thanks to Samuele Pedroni

import new

def _proto_acc(v=None):
    def acc():
        return v
    return acc

_acc0 = _proto_acc()

_make_acc = lambda cell: (new.function (_acc0.func_code,
                                        _acc0.func_globals,
                                        '#cell_acc',
                                        _acc0.func_defaults,
                                        (cell,)
                                        )
                          )

def _cell_deref(cell):
    return _make_acc(cell)()

@@ -1,42 +1,4 @@
-from __future__ import absolute_import
 %0A# c
@@ -52,18 +52,38 @@
 ni%0A%0A
-import new
+from types import FunctionType
 %0A%0Ade
@@ -204,37 +204,35 @@
 l: (
-new.f
+F
 unction
- 
+Type
 (_acc0.
-func
+_
 _code
+__
 ,%0A  
@@ -279,20 +279,17 @@
 cc0.
-func
+_
 _globals
 ,%0A  
@@ -284,16 +284,18 @@
 _globals
+__
 ,%0A      
@@ -391,12 +391,9 @@
 cc0.
-func
+_
 _def
@@ -397,16 +397,18 @@
 defaults
+__
 ,%0A      

replace new.function with types.FunctionType for python3