[Jython-checkins] jython: Now one can manually restore an object's finalizer via

jim.baker jython-checkins at python.org
Thu Sep 4 06:35:37 CEST 2014


http://hg.python.org/jython/rev/4a04ad5e201b
changeset:   7361:4a04ad5e201b
user:        Stefan Richthofer <stefan.richthofer at gmx.de>
date:        Tue Aug 26 14:21:45 2014 +0200
summary:
  Now one can manually restore an object's finalizer via someObject.__ensure_finalizer__. Additionally I cleaned up out-commented and dead code and changed the indentation style in test_finalizers.py to comply with Jython's coding guideline. I also refectored the method names __del__Builtin and __del__Derived to __del_builtin__ and __del_derived__.

files:
  Lib/test/test_finalizers.py                                              |  615 +++++----
  src/org/python/antlr/ast/AssertDerived.java                              |    4 +-
  src/org/python/antlr/ast/AssignDerived.java                              |    4 +-
  src/org/python/antlr/ast/AttributeDerived.java                           |    4 +-
  src/org/python/antlr/ast/AugAssignDerived.java                           |    4 +-
  src/org/python/antlr/ast/BinOpDerived.java                               |    4 +-
  src/org/python/antlr/ast/BoolOpDerived.java                              |    4 +-
  src/org/python/antlr/ast/BreakDerived.java                               |    4 +-
  src/org/python/antlr/ast/CallDerived.java                                |    4 +-
  src/org/python/antlr/ast/ClassDefDerived.java                            |    4 +-
  src/org/python/antlr/ast/CompareDerived.java                             |    4 +-
  src/org/python/antlr/ast/ContinueDerived.java                            |    4 +-
  src/org/python/antlr/ast/DeleteDerived.java                              |    4 +-
  src/org/python/antlr/ast/DictDerived.java                                |    4 +-
  src/org/python/antlr/ast/EllipsisDerived.java                            |    4 +-
  src/org/python/antlr/ast/ExceptHandlerDerived.java                       |    4 +-
  src/org/python/antlr/ast/ExecDerived.java                                |    4 +-
  src/org/python/antlr/ast/ExprDerived.java                                |    4 +-
  src/org/python/antlr/ast/ExpressionDerived.java                          |    4 +-
  src/org/python/antlr/ast/ExtSliceDerived.java                            |    4 +-
  src/org/python/antlr/ast/ForDerived.java                                 |    4 +-
  src/org/python/antlr/ast/FunctionDefDerived.java                         |    4 +-
  src/org/python/antlr/ast/GeneratorExpDerived.java                        |    4 +-
  src/org/python/antlr/ast/GlobalDerived.java                              |    4 +-
  src/org/python/antlr/ast/IfDerived.java                                  |    4 +-
  src/org/python/antlr/ast/IfExpDerived.java                               |    4 +-
  src/org/python/antlr/ast/ImportDerived.java                              |    4 +-
  src/org/python/antlr/ast/ImportFromDerived.java                          |    4 +-
  src/org/python/antlr/ast/IndexDerived.java                               |    4 +-
  src/org/python/antlr/ast/InteractiveDerived.java                         |    4 +-
  src/org/python/antlr/ast/LambdaDerived.java                              |    4 +-
  src/org/python/antlr/ast/ListCompDerived.java                            |    4 +-
  src/org/python/antlr/ast/ListDerived.java                                |    4 +-
  src/org/python/antlr/ast/ModuleDerived.java                              |    4 +-
  src/org/python/antlr/ast/NameDerived.java                                |    4 +-
  src/org/python/antlr/ast/NumDerived.java                                 |    4 +-
  src/org/python/antlr/ast/PassDerived.java                                |    4 +-
  src/org/python/antlr/ast/PrintDerived.java                               |    4 +-
  src/org/python/antlr/ast/RaiseDerived.java                               |    4 +-
  src/org/python/antlr/ast/ReprDerived.java                                |    4 +-
  src/org/python/antlr/ast/ReturnDerived.java                              |    4 +-
  src/org/python/antlr/ast/SliceDerived.java                               |    4 +-
  src/org/python/antlr/ast/StrDerived.java                                 |    4 +-
  src/org/python/antlr/ast/SubscriptDerived.java                           |    4 +-
  src/org/python/antlr/ast/SuiteDerived.java                               |    4 +-
  src/org/python/antlr/ast/TryExceptDerived.java                           |    4 +-
  src/org/python/antlr/ast/TryFinallyDerived.java                          |    4 +-
  src/org/python/antlr/ast/TupleDerived.java                               |    4 +-
  src/org/python/antlr/ast/UnaryOpDerived.java                             |    4 +-
  src/org/python/antlr/ast/WhileDerived.java                               |    4 +-
  src/org/python/antlr/ast/WithDerived.java                                |    4 +-
  src/org/python/antlr/ast/YieldDerived.java                               |    4 +-
  src/org/python/antlr/ast/aliasDerived.java                               |    4 +-
  src/org/python/antlr/ast/argumentsDerived.java                           |    4 +-
  src/org/python/antlr/ast/comprehensionDerived.java                       |    4 +-
  src/org/python/antlr/ast/keywordDerived.java                             |    4 +-
  src/org/python/antlr/op/AddDerived.java                                  |    4 +-
  src/org/python/antlr/op/AndDerived.java                                  |    4 +-
  src/org/python/antlr/op/AugLoadDerived.java                              |    4 +-
  src/org/python/antlr/op/AugStoreDerived.java                             |    4 +-
  src/org/python/antlr/op/BitAndDerived.java                               |    4 +-
  src/org/python/antlr/op/BitOrDerived.java                                |    4 +-
  src/org/python/antlr/op/BitXorDerived.java                               |    4 +-
  src/org/python/antlr/op/DelDerived.java                                  |    4 +-
  src/org/python/antlr/op/DivDerived.java                                  |    4 +-
  src/org/python/antlr/op/EqDerived.java                                   |    4 +-
  src/org/python/antlr/op/FloorDivDerived.java                             |    4 +-
  src/org/python/antlr/op/GtDerived.java                                   |    4 +-
  src/org/python/antlr/op/GtEDerived.java                                  |    4 +-
  src/org/python/antlr/op/InDerived.java                                   |    4 +-
  src/org/python/antlr/op/InvertDerived.java                               |    4 +-
  src/org/python/antlr/op/IsDerived.java                                   |    4 +-
  src/org/python/antlr/op/IsNotDerived.java                                |    4 +-
  src/org/python/antlr/op/LShiftDerived.java                               |    4 +-
  src/org/python/antlr/op/LoadDerived.java                                 |    4 +-
  src/org/python/antlr/op/LtDerived.java                                   |    4 +-
  src/org/python/antlr/op/LtEDerived.java                                  |    4 +-
  src/org/python/antlr/op/ModDerived.java                                  |    4 +-
  src/org/python/antlr/op/MultDerived.java                                 |    4 +-
  src/org/python/antlr/op/NotDerived.java                                  |    4 +-
  src/org/python/antlr/op/NotEqDerived.java                                |    4 +-
  src/org/python/antlr/op/NotInDerived.java                                |    4 +-
  src/org/python/antlr/op/OrDerived.java                                   |    4 +-
  src/org/python/antlr/op/ParamDerived.java                                |    4 +-
  src/org/python/antlr/op/PowDerived.java                                  |    4 +-
  src/org/python/antlr/op/RShiftDerived.java                               |    4 +-
  src/org/python/antlr/op/StoreDerived.java                                |    4 +-
  src/org/python/antlr/op/SubDerived.java                                  |    4 +-
  src/org/python/antlr/op/UAddDerived.java                                 |    4 +-
  src/org/python/antlr/op/USubDerived.java                                 |    4 +-
  src/org/python/core/ClasspathPyImporterDerived.java                      |    4 +-
  src/org/python/core/Py.java                                              |    3 +-
  src/org/python/core/PyArrayDerived.java                                  |    4 +-
  src/org/python/core/PyBaseExceptionDerived.java                          |    4 +-
  src/org/python/core/PyByteArrayDerived.java                              |    4 +-
  src/org/python/core/PyClass.java                                         |    6 -
  src/org/python/core/PyClassMethodDerived.java                            |    4 +-
  src/org/python/core/PyComplexDerived.java                                |    4 +-
  src/org/python/core/PyDictionaryDerived.java                             |    4 +-
  src/org/python/core/PyEnumerateDerived.java                              |    4 +-
  src/org/python/core/PyFile.java                                          |    2 +-
  src/org/python/core/PyFileDerived.java                                   |    4 +-
  src/org/python/core/PyFloatDerived.java                                  |    4 +-
  src/org/python/core/PyFrozenSetDerived.java                              |    4 +-
  src/org/python/core/PyGenerator.java                                     |    2 +-
  src/org/python/core/PyInstance.java                                      |   39 +-
  src/org/python/core/PyIntegerDerived.java                                |    4 +-
  src/org/python/core/PyListDerived.java                                   |    4 +-
  src/org/python/core/PyLongDerived.java                                   |    4 +-
  src/org/python/core/PyModuleDerived.java                                 |    4 +-
  src/org/python/core/PyObject.java                                        |    7 +
  src/org/python/core/PyObjectDerived.java                                 |    4 +-
  src/org/python/core/PyPropertyDerived.java                               |    4 +-
  src/org/python/core/PySetDerived.java                                    |    4 +-
  src/org/python/core/PyStringDerived.java                                 |    4 +-
  src/org/python/core/PySuperDerived.java                                  |    4 +-
  src/org/python/core/PyTupleDerived.java                                  |    4 +-
  src/org/python/core/PyTypeDerived.java                                   |    4 +-
  src/org/python/core/PyUnicodeDerived.java                                |    4 +-
  src/org/python/core/finalization/FinalizableBuiltin.java                 |   12 +-
  src/org/python/core/finalization/FinalizablePyObject.java                |   14 +-
  src/org/python/core/finalization/FinalizablePyObjectDerived.java         |   14 +-
  src/org/python/core/finalization/FinalizeTrigger.java                    |   43 +-
  src/org/python/modules/PyStructDerived.java                              |    4 +-
  src/org/python/modules/_collections/PyDefaultDictDerived.java            |    4 +-
  src/org/python/modules/_collections/PyDequeDerived.java                  |    4 +-
  src/org/python/modules/_csv/PyDialectDerived.java                        |    4 +-
  src/org/python/modules/_functools/PyPartialDerived.java                  |    4 +-
  src/org/python/modules/_io/PyFileIODerived.java                          |    4 +-
  src/org/python/modules/_io/PyIOBase.java                                 |    2 +-
  src/org/python/modules/_io/PyIOBaseDerived.java                          |    4 +-
  src/org/python/modules/_io/PyRawIOBaseDerived.java                       |    4 +-
  src/org/python/modules/_weakref/ReferenceTypeDerived.java                |    4 +-
  src/org/python/modules/bz2/PyBZ2CompressorDerived.java                   |    4 +-
  src/org/python/modules/bz2/PyBZ2DecompressorDerived.java                 |    4 +-
  src/org/python/modules/bz2/PyBZ2File.java                                |    2 +-
  src/org/python/modules/bz2/PyBZ2FileDerived.java                         |    4 +-
  src/org/python/modules/itertools/PyTeeIteratorDerived.java               |    4 +-
  src/org/python/modules/itertools/chainDerived.java                       |    4 +-
  src/org/python/modules/itertools/combinationsDerived.java                |    4 +-
  src/org/python/modules/itertools/combinationsWithReplacementDerived.java |    4 +-
  src/org/python/modules/itertools/compressDerived.java                    |    4 +-
  src/org/python/modules/itertools/countDerived.java                       |    4 +-
  src/org/python/modules/itertools/cycleDerived.java                       |    4 +-
  src/org/python/modules/itertools/dropwhileDerived.java                   |    4 +-
  src/org/python/modules/itertools/groupbyDerived.java                     |    4 +-
  src/org/python/modules/itertools/ifilterDerived.java                     |    4 +-
  src/org/python/modules/itertools/ifilterfalseDerived.java                |    4 +-
  src/org/python/modules/itertools/isliceDerived.java                      |    4 +-
  src/org/python/modules/itertools/izipDerived.java                        |    4 +-
  src/org/python/modules/itertools/izipLongestDerived.java                 |    4 +-
  src/org/python/modules/itertools/permutationsDerived.java                |    4 +-
  src/org/python/modules/itertools/productDerived.java                     |    4 +-
  src/org/python/modules/itertools/repeatDerived.java                      |    4 +-
  src/org/python/modules/itertools/starmapDerived.java                     |    4 +-
  src/org/python/modules/itertools/takewhileDerived.java                   |    4 +-
  src/org/python/modules/random/PyRandomDerived.java                       |    4 +-
  src/org/python/modules/thread/PyLocalDerived.java                        |    4 +-
  src/org/python/modules/zipimport/zipimporterDerived.java                 |    4 +-
  src/templates/gderived-defs                                              |    6 +-
  src/templates/object.derived                                             |    1 -
  161 files changed, 665 insertions(+), 687 deletions(-)


diff --git a/Lib/test/test_finalizers.py b/Lib/test/test_finalizers.py
--- a/Lib/test/test_finalizers.py
+++ b/Lib/test/test_finalizers.py
@@ -2,32 +2,34 @@
 Created on 06.08.2014
 '''
 
-import platform
 import unittest
 import types
 import time
-if platform.system() == "Java":
-	from java.lang import System
-	from org.python.core.finalization import FinalizeTrigger
+try:
+    from java.lang import System
+except:
+    pass
 
 class GCDetector():
-	gcIndex = 0
-	
-	def __del__(self):
-		GCDetector.gcIndex += 1
+    gcIndex = 0
+    
+    def __del__(self):
+        GCDetector.gcIndex += 1
 
 maxGCRun = 10
 
 def runGCIfJython():
-	if platform.system() == "Java":
-		currentIndex = GCDetector.gcIndex
-		gcCount = 0
-		detector = GCDetector()
-		detector = None
-		while currentIndex == GCDetector.gcIndex and gcCount < maxGCRun:
-			System.gc()
-			gcCount += 1
-			time.sleep(0.1)
+    try:
+        currentIndex = GCDetector.gcIndex
+        gcCount = 0
+        detector = GCDetector()
+        detector = None
+        while currentIndex == GCDetector.gcIndex and gcCount < maxGCRun:
+            System.gc()
+            gcCount += 1
+            time.sleep(0.1)
+    except:
+        pass
 
 finalizeMsgList = []
 verbose = False
@@ -40,71 +42,71 @@
 
 class ResurrectableDummyClass():
 
-	def __init__(self, name):
-		self.name = name
-		self.doResurrection = True
+    def __init__(self, name):
+        self.name = name
+        self.doResurrection = True
 
-	def __str__(self):
-		return self.name
+    def __str__(self):
+        return self.name
 
 
 class ResurrectableDummyClassNew(object):
 
-	def __init__(self, name):
-		self.name = name
-		self.doResurrection = True
+    def __init__(self, name):
+        self.name = name
+        self.doResurrection = True
 
-	def __str__(self):
-		return self.name
+    def __str__(self):
+        return self.name
 
 
 def __del__I(self):
-	global resurrectedObject_I
-	finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
-	if verbose:
-		print str(self)+" finalized (ResurrectableDummyClass)"
-	if self.doResurrection:
-		resurrectedObject_I = self
+    global resurrectedObject_I
+    finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
+    if verbose:
+        print str(self)+" finalized (ResurrectableDummyClass)"
+    if self.doResurrection:
+        resurrectedObject_I = self
 
 def __del__J(self):
-	global resurrectedObject_J
-	finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
-	if verbose:
-		print str(self)+" finalized (ResurrectableDummyClass)"
-	if self.doResurrection:
-		resurrectedObject_J = self
+    global resurrectedObject_J
+    finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
+    if verbose:
+        print str(self)+" finalized (ResurrectableDummyClass)"
+    if self.doResurrection:
+        resurrectedObject_J = self
 
 def __del__K(self):
-	global resurrectedObject_K
-	finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
-	if verbose:
-		print str(self)+" finalized (ResurrectableDummyClass)"
-	if self.doResurrection:
-		resurrectedObject_K = self
+    global resurrectedObject_K
+    finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
+    if verbose:
+        print str(self)+" finalized (ResurrectableDummyClass)"
+    if self.doResurrection:
+        resurrectedObject_K = self
 
 def __del__L(self):
-	global resurrectedObject_L
-	finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
-	if verbose:
-		print str(self)+" finalized (ResurrectableDummyClass)"
-	if self.doResurrection:
-		resurrectedObject_L = self
+    global resurrectedObject_L
+    finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
+    if verbose:
+        print str(self)+" finalized (ResurrectableDummyClass)"
+    if self.doResurrection:
+        resurrectedObject_L = self
 
 def __del__M(self):
-	global resurrectedObject_M
-	finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
-	if verbose:
-		print str(self)+" finalized (ResurrectableDummyClass)"
-	if self.doResurrection:
-		resurrectedObject_M = self
+    global resurrectedObject_M
+    finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
+    if verbose:
+        print str(self)+" finalized (ResurrectableDummyClass)"
+    if self.doResurrection:
+        resurrectedObject_M = self
 
 def __del__N(self):
-	global resurrectedObject_N
-	finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
-	if verbose:
-		print str(self)+" finalized (ResurrectableDummyClass)"
-	if self.doResurrection:
-		resurrectedObject_N = self
+    global resurrectedObject_N
+    finalizeMsgList.append(str(self)+" finalized (ResurrectableDummyClass)")
+    if verbose:
+        print str(self)+" finalized (ResurrectableDummyClass)"
+    if self.doResurrection:
+        resurrectedObject_N = self
 
 delI = __del__I
 delJ = __del__J
@@ -115,289 +117,302 @@
 
 
 class DummyClass():
-	
-	def __init__(self, name):
-		self.name = name
-	
-	def __str__(self):
-		return self.name
+    
+    def __init__(self, name):
+        self.name = name
+    
+    def __str__(self):
+        return self.name
 
 
 class DummyClassDel():
-	
-	def __init__(self, name):
-		self.name = name
-	
-	def __str__(self):
-		return self.name
-	
-	def __del__(self):
-		finalizeMsgList.append(str(self)+" finalized (DummyClassDel)")
-		if verbose:
-			print str(self)+" finalized (DummyClassDel)"
+    
+    def __init__(self, name):
+        self.name = name
+    
+    def __str__(self):
+        return self.name
+    
+    def __del__(self):
+        finalizeMsgList.append(str(self)+" finalized (DummyClassDel)")
+        if verbose:
+            print str(self)+" finalized (DummyClassDel)"
 
 
 class DummyClassNew(object):
-	
-	def __init__(self, name):
-		self.name = name
-	
-	def __str__(self):
-		return self.name
+    
+    def __init__(self, name):
+        self.name = name
+    
+    def __str__(self):
+        return self.name
 
 class DummyClassDelNew(object):
-	
-	def __init__(self, name):
-		self.name = name
-	
-	def __str__(self):
-		return self.name
-	
-	def __del__(self):
-		finalizeMsgList.append(str(self)+" finalized (DummyClassDelNew)")
-		if verbose:
-			print str(self)+" finalized (DummyClassDelNew)"
+    
+    def __init__(self, name):
+        self.name = name
+    
+    def __str__(self):
+        return self.name
+    
+    def __del__(self):
+        finalizeMsgList.append(str(self)+" finalized (DummyClassDelNew)")
+        if verbose:
+            print str(self)+" finalized (DummyClassDelNew)"
 
 class DummyFileClassNew(file):
-	
-	def __init__(self, name):
-		self.name0 = name
-	
-	def __str__(self):
-		return self.name0
+    
+    def __init__(self, name):
+        self.name0 = name
+    
+    def __str__(self):
+        return self.name0
 
-	def __del__(self):
-		finalizeMsgList.append(str(self)+" finalized (DummyFileClassNew)")
-		if verbose:
-			print str(self)+" finalized (DummyFileClassNew)"
+    def __del__(self):
+        finalizeMsgList.append(str(self)+" finalized (DummyFileClassNew)")
+        if verbose:
+            print str(self)+" finalized (DummyFileClassNew)"
 
 
 def __del__class(self):
-	finalizeMsgList.append(str(self)+" finalized (acquired by class)")
-	if verbose:
-		print str(self)+" finalized (acquired by class)"
+    finalizeMsgList.append(str(self)+" finalized (acquired by class)")
+    if verbose:
+        print str(self)+" finalized (acquired by class)"
 
 def __del__object(self):
-	finalizeMsgList.append(str(self)+" finalized (acquired by object)")
-	if verbose:
-		print str(self)+" finalized (acquired by object)"
+    finalizeMsgList.append(str(self)+" finalized (acquired by object)")
+    if verbose:
+        print str(self)+" finalized (acquired by object)"
 
 def __del__object0():
-	finalizeMsgList.append("_ finalized (acquired by object)")
-	if verbose:
-		print "_ finalized (acquired by object)"
+    finalizeMsgList.append("_ finalized (acquired by object)")
+    if verbose:
+        print "_ finalized (acquired by object)"
 
 delClass = __del__class
 delObject = __del__object
 delObject0 = __del__object0
 
 class TestFinalizers(unittest.TestCase):
-	def test_finalizer_builtin_oldStyleClass(self):
-		A = DummyClassDel("A")
-		A = None
-		runGCIfJython()
-		assert("A finalized (DummyClassDel)" in finalizeMsgList)
+    def test_finalizer_builtin_oldStyleClass(self):
+        A = DummyClassDel("A")
+        A = None
+        runGCIfJython()
+        assert("A finalized (DummyClassDel)" in finalizeMsgList)
 
-	def test_classAcquiresFinalizer_beforeInstanciation_oldStyleClass(self):
-		DummyClass.__del__ = delClass
-		B = DummyClass("B")
-		B = None
-		runGCIfJython()
-		assert("B finalized (acquired by class)" in finalizeMsgList)
-		del DummyClass.__del__
+    def test_classAcquiresFinalizer_beforeInstanciation_oldStyleClass(self):
+        DummyClass.__del__ = delClass
+        B = DummyClass("B")
+        B = None
+        runGCIfJython()
+        assert("B finalized (acquired by class)" in finalizeMsgList)
+        del DummyClass.__del__
 
-	def test_classAcquiresFinalizer_afterInstanciation_oldStyleClass(self):
-		#okay to fail in Jython without the manual ensureFinalizer call
-		C = DummyClass("C")
-		DummyClass.__del__ = delClass
-		if platform.system() == "Java":
-			FinalizeTrigger.ensureFinalizer(C)
-		C = None
-		runGCIfJython()
-		assert("C finalized (acquired by class)" in finalizeMsgList)
-		del DummyClass.__del__
+    def test_classAcquiresFinalizer_afterInstanciation_oldStyleClass(self):
+        #okay to fail in Jython without the manual ensureFinalizer call
+        C = DummyClass("C")
+        DummyClass.__del__ = delClass
+        try:
+            C.__ensure_finalizer__()
+        except:
+            pass
+        C = None
+        runGCIfJython()
+        assert("C finalized (acquired by class)" in finalizeMsgList)
+        del DummyClass.__del__
 
-	def test_instanceAcquiresFinalizer_bound_oldStyleClass(self):
-		D = DummyClassDel("D")
-		dl = types.MethodType(delObject, D.name)
-		D.__del__ = dl
-		D = None
-		runGCIfJython()
-		assert("D finalized (DummyClassDel)" not in finalizeMsgList)
-		assert("D finalized (acquired by object)" in finalizeMsgList)
+    def test_instanceAcquiresFinalizer_bound_oldStyleClass(self):
+        D = DummyClassDel("D")
+        dl = types.MethodType(delObject, D.name)
+        D.__del__ = dl
+        D = None
+        runGCIfJython()
+        assert("D finalized (DummyClassDel)" not in finalizeMsgList)
+        assert("D finalized (acquired by object)" in finalizeMsgList)
 
-	def test_finalizer_builtin_newStyleClass(self):
-		E = DummyClassDelNew("E")
-		E = None
-		runGCIfJython()
-		assert("E finalized (DummyClassDelNew)" in finalizeMsgList)
+    def test_finalizer_builtin_newStyleClass(self):
+        E = DummyClassDelNew("E")
+        E = None
+        runGCIfJython()
+        assert("E finalized (DummyClassDelNew)" in finalizeMsgList)
 
-	def test_classAcquiresFinalizer_beforeInstanciation_newStyleClass(self):
-		DummyClassNew.__del__ = delClass
-		F = DummyClassNew("F")
-		F = None
-		runGCIfJython()
-		assert("F finalized (acquired by class)" in finalizeMsgList)
-		del DummyClassNew.__del__
+    def test_classAcquiresFinalizer_beforeInstanciation_newStyleClass(self):
+        DummyClassNew.__del__ = delClass
+        F = DummyClassNew("F")
+        F = None
+        runGCIfJython()
+        assert("F finalized (acquired by class)" in finalizeMsgList)
+        del DummyClassNew.__del__
 
-	def test_classAcquiresFinalizer_afterInstanciation_newStyleClass(self):
-		#okay to fail in Jython without the manual ensureFinalizer call
-		G = DummyClassNew("G")
-		DummyClassNew.__del__ = delClass
-		if platform.system() == "Java":
-			FinalizeTrigger.ensureFinalizer(G)
-		G = None
-		runGCIfJython()
-		assert("G finalized (acquired by class)" in finalizeMsgList)
-		del DummyClassNew.__del__
+    def test_classAcquiresFinalizer_afterInstanciation_newStyleClass(self):
+        #okay to fail in Jython without the manual ensureFinalizer call
+        G = DummyClassNew("G")
+        DummyClassNew.__del__ = delClass
+        try:
+            G.__ensure_finalizer__()
+        except:
+            pass
+        G = None
+        runGCIfJython()
+        assert("G finalized (acquired by class)" in finalizeMsgList)
+        del DummyClassNew.__del__
 
-	def test_instanceAcquiresFinalizer_bound_newStyleClass(self):
-		"""
-		It seems, CPython prohibits new style instances from acquiring a finalizer.
-		"""
-		H = DummyClassDelNew("H")
-		H.__del__ = types.MethodType(delObject, H.name)
-		H = None
-		runGCIfJython()
-		assert("H finalized (DummyClassDelNew)" in finalizeMsgList)
-		assert("H finalized (acquired by object)" not in finalizeMsgList)
+    def test_instanceAcquiresFinalizer_bound_newStyleClass(self):
+        """
+        It seems, CPython prohibits new style instances from acquiring a finalizer.
+        """
+        H = DummyClassDelNew("H")
+        H.__del__ = types.MethodType(delObject, H.name)
+        H = None
+        runGCIfJython()
+        assert("H finalized (DummyClassDelNew)" in finalizeMsgList)
+        assert("H finalized (acquired by object)" not in finalizeMsgList)
 
-	def test_instanceAcquiresFinalizer_bound_newStyleClass2(self):
-		"""
-		It seems, CPython prohibits new style instances from acquiring a finalizer.
-		If one calls the instance-acquired __del__ manually, it works, but the gc
-		will still call the old one.
-		"""
-		H = DummyClassDelNew("H2")
-		H.__del__ = types.MethodType(delObject, H.name)
-		H.__del__()
-		H = None
-		runGCIfJython()
-		assert("H2 finalized (DummyClassDelNew)" in finalizeMsgList)
-		assert("H2 finalized (acquired by object)" in finalizeMsgList)
+    def test_instanceAcquiresFinalizer_bound_newStyleClass2(self):
+        """
+        It seems, CPython prohibits new style instances from acquiring a finalizer.
+        If one calls the instance-acquired __del__ manually, it works, but the gc
+        will still call the old one.
+        """
+        H = DummyClassDelNew("H2")
+        H.__del__ = types.MethodType(delObject, H.name)
+        H.__del__()
+        H = None
+        runGCIfJython()
+        assert("H2 finalized (DummyClassDelNew)" in finalizeMsgList)
+        assert("H2 finalized (acquired by object)" in finalizeMsgList)
 
-	def test_objectResurrection_oldStyleClass(self):
-		ResurrectableDummyClass.__del__ = delI
-		I = ResurrectableDummyClass("I")
-		I = None
-		runGCIfJython()
-		assert("I finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		assert(str(resurrectedObject_I) == "I")
+    def test_objectResurrection_oldStyleClass(self):
+        ResurrectableDummyClass.__del__ = delI
+        I = ResurrectableDummyClass("I")
+        I = None
+        runGCIfJython()
+        assert("I finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        assert(str(resurrectedObject_I) == "I")
 
-	def test_objectDoubleResurrection_oldStyleClass(self):
-		#okay to fail in Jython without the manual ensureFinalizer calls
-		ResurrectableDummyClass.__del__ = delJ
-		J = ResurrectableDummyClass("J")
-		J = None
-		
-		runGCIfJython()
-		assert("J finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		global resurrectedObject_J
-		assert(str(resurrectedObject_J) == "J")
-		J = resurrectedObject_J
-		resurrectedObject_J = None
-		assert(resurrectedObject_J is None)
-		if platform.system() == "Java":
-			#For Jython one can restore the finalizer manually.
-			#This is offered as an easy fix if the CPython behavior
-			#in this test should be needed for some reason.
-			FinalizeTrigger.ensureFinalizer(J)
-		J = None
+    def test_objectDoubleResurrection_oldStyleClass(self):
+        #okay to fail in Jython without the manual ensureFinalizer calls
+        ResurrectableDummyClass.__del__ = delJ
+        J = ResurrectableDummyClass("J")
+        J = None
+        
+        runGCIfJython()
+        assert("J finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        global resurrectedObject_J
+        assert(str(resurrectedObject_J) == "J")
+        J = resurrectedObject_J
+        resurrectedObject_J = None
+        assert(resurrectedObject_J is None)
+        try:
+            #For Jython one can restore the finalizer manually.
+            #This is offered as an easy fix if the CPython behavior
+            #in this test should be needed for some reason.
+            J.__ensure_finalizer__()
+        except:
+            pass
+        J = None
 
-		runGCIfJython()
-		assert(str(resurrectedObject_J) == "J")
-		resurrectedObject_J.doResurrection = False
-		if platform.system() == "Java":
-			#again...
-			FinalizeTrigger.ensureFinalizer(resurrectedObject_J)
-		resurrectedObject_J = None
-		
-		runGCIfJython()
-		assert(resurrectedObject_J is None)
-		
+        runGCIfJython()
+        assert(str(resurrectedObject_J) == "J")
+        resurrectedObject_J.doResurrection = False
+        try:
+            #again...
+            resurrectedObject_J.__ensure_finalizer__()
+        except:
+            pass
+        resurrectedObject_J = None
+        
+        runGCIfJython()
+        assert(resurrectedObject_J is None)
+        
 
-	def test_objectDoubleResurrectionAndFinalize_oldStyleClass(self):
-		#okay to fail in Jython without the manual ensureFinalizer calls
-		ResurrectableDummyClass.__del__ = delK
-		K = ResurrectableDummyClass("K")
-		K = None
-		
-		runGCIfJython()
-		assert("K finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		finalizeMsgList.remove("K finalized (ResurrectableDummyClass)")
-		assert("K finalized (ResurrectableDummyClass)" not in finalizeMsgList)
-		global resurrectedObject_K
-		assert(str(resurrectedObject_K) == "K")
-		K = resurrectedObject_K
-		resurrectedObject_K = None
-		assert(resurrectedObject_K is None)
-		if platform.system() == "Java":
-			FinalizeTrigger.ensureFinalizer(K)
-		K = None
-		
-		runGCIfJython()
-		assert("K finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		assert(str(resurrectedObject_K) == "K")
+    def test_objectDoubleResurrectionAndFinalize_oldStyleClass(self):
+        #okay to fail in Jython without the manual ensureFinalizer calls
+        ResurrectableDummyClass.__del__ = delK
+        K = ResurrectableDummyClass("K")
+        K = None
 
-	def test_objectResurrection_newStyleClass(self):
-		ResurrectableDummyClassNew.__del__ = delL
-		L = ResurrectableDummyClassNew("L")
-		L = None
-		runGCIfJython()
-		assert("L finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		assert(str(resurrectedObject_L) == "L")
+        runGCIfJython()
+        assert("K finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        finalizeMsgList.remove("K finalized (ResurrectableDummyClass)")
+        assert("K finalized (ResurrectableDummyClass)" not in finalizeMsgList)
+        global resurrectedObject_K
+        assert(str(resurrectedObject_K) == "K")
+        K = resurrectedObject_K
+        resurrectedObject_K = None
+        assert(resurrectedObject_K is None)
+        try:
+            K.__ensure_finalizer__()
+        except:
+            pass
+        K = None
 
-	def test_objectDoubleResurrection_newStyleClass(self):
-		#okay to fail in Jython without the manual ensureFinalizer calls
-		ResurrectableDummyClassNew.__del__ = delM
-		M = ResurrectableDummyClassNew("M")
-		M = None
+        runGCIfJython()
+        assert("K finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        assert(str(resurrectedObject_K) == "K")
 
-		runGCIfJython()
-		assert("M finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		global resurrectedObject_M
-		assert(str(resurrectedObject_M) == "M")
-		M = resurrectedObject_M
-		resurrectedObject_M = None
-		assert(resurrectedObject_M is None)
-		if platform.system() == "Java":
-			FinalizeTrigger.ensureFinalizer(M)
-		M = None
+    def test_objectResurrection_newStyleClass(self):
+        ResurrectableDummyClassNew.__del__ = delL
+        L = ResurrectableDummyClassNew("L")
+        L = None
+        runGCIfJython()
+        assert("L finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        assert(str(resurrectedObject_L) == "L")
 
-		runGCIfJython()
-		assert(str(resurrectedObject_M) == "M")
+    def test_objectDoubleResurrection_newStyleClass(self):
+        #okay to fail in Jython without the manual ensureFinalizer calls
+        ResurrectableDummyClassNew.__del__ = delM
+        M = ResurrectableDummyClassNew("M")
+        M = None
 
-	def test_objectDoubleResurrectionAndFinalize_newStyleClass(self):
-		#okay to fail in Jython without the manual ensureFinalizer calls
-		ResurrectableDummyClassNew.__del__ = delN
-		N = ResurrectableDummyClassNew("N")
-		N = None
+        runGCIfJython()
+        assert("M finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        global resurrectedObject_M
+        assert(str(resurrectedObject_M) == "M")
+        M = resurrectedObject_M
+        resurrectedObject_M = None
+        assert(resurrectedObject_M is None)
+        try:
+            M.__ensure_finalizer__()
+        except:
+            pass
+        M = None
 
-		runGCIfJython()
-		assert("N finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		finalizeMsgList.remove("N finalized (ResurrectableDummyClass)")
-		assert("N finalized (ResurrectableDummyClass)" not in finalizeMsgList)
-		global resurrectedObject_N
-		assert(str(resurrectedObject_N) == "N")
-		N = resurrectedObject_N
-		resurrectedObject_N = None
-		assert(resurrectedObject_N is None)
-		if platform.system() == "Java":
-			FinalizeTrigger.ensureFinalizer(N)
-		N = None
+        runGCIfJython()
+        assert(str(resurrectedObject_M) == "M")
 
-		runGCIfJython()
-		assert("N finalized (ResurrectableDummyClass)" in finalizeMsgList)
-		assert(str(resurrectedObject_N) == "N")
+    def test_objectDoubleResurrectionAndFinalize_newStyleClass(self):
+        #okay to fail in Jython without the manual ensureFinalizer calls
+        ResurrectableDummyClassNew.__del__ = delN
+        N = ResurrectableDummyClassNew("N")
+        N = None
 
-	def test_file_overwrite_del(self):
-		O = DummyFileClassNew("O")
-		O = None
+        runGCIfJython()
+        assert("N finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        finalizeMsgList.remove("N finalized (ResurrectableDummyClass)")
+        assert("N finalized (ResurrectableDummyClass)" not in finalizeMsgList)
+        global resurrectedObject_N
+        assert(str(resurrectedObject_N) == "N")
+        N = resurrectedObject_N
+        resurrectedObject_N = None
+        assert(resurrectedObject_N is None)
+        try:
+            N.__ensure_finalizer__()
+        except:
+            pass
+        N = None
 
-		runGCIfJython()
-		assert("O finalized (DummyFileClassNew)" in finalizeMsgList)
+        runGCIfJython()
+        assert("N finalized (ResurrectableDummyClass)" in finalizeMsgList)
+        assert(str(resurrectedObject_N) == "N")
 
+    def test_file_overwrite_del(self):
+        O = DummyFileClassNew("O")
+        O = None
+
+        runGCIfJython()
+        assert("O finalized (DummyFileClassNew)" in finalizeMsgList)
 
 if __name__ == '__main__':
-	unittest.main()
+    unittest.main()
 
diff --git a/src/org/python/antlr/ast/AssertDerived.java b/src/org/python/antlr/ast/AssertDerived.java
--- a/src/org/python/antlr/ast/AssertDerived.java
+++ b/src/org/python/antlr/ast/AssertDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/AssignDerived.java b/src/org/python/antlr/ast/AssignDerived.java
--- a/src/org/python/antlr/ast/AssignDerived.java
+++ b/src/org/python/antlr/ast/AssignDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/AttributeDerived.java b/src/org/python/antlr/ast/AttributeDerived.java
--- a/src/org/python/antlr/ast/AttributeDerived.java
+++ b/src/org/python/antlr/ast/AttributeDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/AugAssignDerived.java b/src/org/python/antlr/ast/AugAssignDerived.java
--- a/src/org/python/antlr/ast/AugAssignDerived.java
+++ b/src/org/python/antlr/ast/AugAssignDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/BinOpDerived.java b/src/org/python/antlr/ast/BinOpDerived.java
--- a/src/org/python/antlr/ast/BinOpDerived.java
+++ b/src/org/python/antlr/ast/BinOpDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/BoolOpDerived.java b/src/org/python/antlr/ast/BoolOpDerived.java
--- a/src/org/python/antlr/ast/BoolOpDerived.java
+++ b/src/org/python/antlr/ast/BoolOpDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/BreakDerived.java b/src/org/python/antlr/ast/BreakDerived.java
--- a/src/org/python/antlr/ast/BreakDerived.java
+++ b/src/org/python/antlr/ast/BreakDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/CallDerived.java b/src/org/python/antlr/ast/CallDerived.java
--- a/src/org/python/antlr/ast/CallDerived.java
+++ b/src/org/python/antlr/ast/CallDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ClassDefDerived.java b/src/org/python/antlr/ast/ClassDefDerived.java
--- a/src/org/python/antlr/ast/ClassDefDerived.java
+++ b/src/org/python/antlr/ast/ClassDefDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/CompareDerived.java b/src/org/python/antlr/ast/CompareDerived.java
--- a/src/org/python/antlr/ast/CompareDerived.java
+++ b/src/org/python/antlr/ast/CompareDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ContinueDerived.java b/src/org/python/antlr/ast/ContinueDerived.java
--- a/src/org/python/antlr/ast/ContinueDerived.java
+++ b/src/org/python/antlr/ast/ContinueDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/DeleteDerived.java b/src/org/python/antlr/ast/DeleteDerived.java
--- a/src/org/python/antlr/ast/DeleteDerived.java
+++ b/src/org/python/antlr/ast/DeleteDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/DictDerived.java b/src/org/python/antlr/ast/DictDerived.java
--- a/src/org/python/antlr/ast/DictDerived.java
+++ b/src/org/python/antlr/ast/DictDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/EllipsisDerived.java b/src/org/python/antlr/ast/EllipsisDerived.java
--- a/src/org/python/antlr/ast/EllipsisDerived.java
+++ b/src/org/python/antlr/ast/EllipsisDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ExceptHandlerDerived.java b/src/org/python/antlr/ast/ExceptHandlerDerived.java
--- a/src/org/python/antlr/ast/ExceptHandlerDerived.java
+++ b/src/org/python/antlr/ast/ExceptHandlerDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ExecDerived.java b/src/org/python/antlr/ast/ExecDerived.java
--- a/src/org/python/antlr/ast/ExecDerived.java
+++ b/src/org/python/antlr/ast/ExecDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ExprDerived.java b/src/org/python/antlr/ast/ExprDerived.java
--- a/src/org/python/antlr/ast/ExprDerived.java
+++ b/src/org/python/antlr/ast/ExprDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ExpressionDerived.java b/src/org/python/antlr/ast/ExpressionDerived.java
--- a/src/org/python/antlr/ast/ExpressionDerived.java
+++ b/src/org/python/antlr/ast/ExpressionDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ExtSliceDerived.java b/src/org/python/antlr/ast/ExtSliceDerived.java
--- a/src/org/python/antlr/ast/ExtSliceDerived.java
+++ b/src/org/python/antlr/ast/ExtSliceDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ForDerived.java b/src/org/python/antlr/ast/ForDerived.java
--- a/src/org/python/antlr/ast/ForDerived.java
+++ b/src/org/python/antlr/ast/ForDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/FunctionDefDerived.java b/src/org/python/antlr/ast/FunctionDefDerived.java
--- a/src/org/python/antlr/ast/FunctionDefDerived.java
+++ b/src/org/python/antlr/ast/FunctionDefDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/GeneratorExpDerived.java b/src/org/python/antlr/ast/GeneratorExpDerived.java
--- a/src/org/python/antlr/ast/GeneratorExpDerived.java
+++ b/src/org/python/antlr/ast/GeneratorExpDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/GlobalDerived.java b/src/org/python/antlr/ast/GlobalDerived.java
--- a/src/org/python/antlr/ast/GlobalDerived.java
+++ b/src/org/python/antlr/ast/GlobalDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/IfDerived.java b/src/org/python/antlr/ast/IfDerived.java
--- a/src/org/python/antlr/ast/IfDerived.java
+++ b/src/org/python/antlr/ast/IfDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/IfExpDerived.java b/src/org/python/antlr/ast/IfExpDerived.java
--- a/src/org/python/antlr/ast/IfExpDerived.java
+++ b/src/org/python/antlr/ast/IfExpDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ImportDerived.java b/src/org/python/antlr/ast/ImportDerived.java
--- a/src/org/python/antlr/ast/ImportDerived.java
+++ b/src/org/python/antlr/ast/ImportDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ImportFromDerived.java b/src/org/python/antlr/ast/ImportFromDerived.java
--- a/src/org/python/antlr/ast/ImportFromDerived.java
+++ b/src/org/python/antlr/ast/ImportFromDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/IndexDerived.java b/src/org/python/antlr/ast/IndexDerived.java
--- a/src/org/python/antlr/ast/IndexDerived.java
+++ b/src/org/python/antlr/ast/IndexDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/InteractiveDerived.java b/src/org/python/antlr/ast/InteractiveDerived.java
--- a/src/org/python/antlr/ast/InteractiveDerived.java
+++ b/src/org/python/antlr/ast/InteractiveDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/LambdaDerived.java b/src/org/python/antlr/ast/LambdaDerived.java
--- a/src/org/python/antlr/ast/LambdaDerived.java
+++ b/src/org/python/antlr/ast/LambdaDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ListCompDerived.java b/src/org/python/antlr/ast/ListCompDerived.java
--- a/src/org/python/antlr/ast/ListCompDerived.java
+++ b/src/org/python/antlr/ast/ListCompDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ListDerived.java b/src/org/python/antlr/ast/ListDerived.java
--- a/src/org/python/antlr/ast/ListDerived.java
+++ b/src/org/python/antlr/ast/ListDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ModuleDerived.java b/src/org/python/antlr/ast/ModuleDerived.java
--- a/src/org/python/antlr/ast/ModuleDerived.java
+++ b/src/org/python/antlr/ast/ModuleDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/NameDerived.java b/src/org/python/antlr/ast/NameDerived.java
--- a/src/org/python/antlr/ast/NameDerived.java
+++ b/src/org/python/antlr/ast/NameDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/NumDerived.java b/src/org/python/antlr/ast/NumDerived.java
--- a/src/org/python/antlr/ast/NumDerived.java
+++ b/src/org/python/antlr/ast/NumDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/PassDerived.java b/src/org/python/antlr/ast/PassDerived.java
--- a/src/org/python/antlr/ast/PassDerived.java
+++ b/src/org/python/antlr/ast/PassDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/PrintDerived.java b/src/org/python/antlr/ast/PrintDerived.java
--- a/src/org/python/antlr/ast/PrintDerived.java
+++ b/src/org/python/antlr/ast/PrintDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/RaiseDerived.java b/src/org/python/antlr/ast/RaiseDerived.java
--- a/src/org/python/antlr/ast/RaiseDerived.java
+++ b/src/org/python/antlr/ast/RaiseDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ReprDerived.java b/src/org/python/antlr/ast/ReprDerived.java
--- a/src/org/python/antlr/ast/ReprDerived.java
+++ b/src/org/python/antlr/ast/ReprDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/ReturnDerived.java b/src/org/python/antlr/ast/ReturnDerived.java
--- a/src/org/python/antlr/ast/ReturnDerived.java
+++ b/src/org/python/antlr/ast/ReturnDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/SliceDerived.java b/src/org/python/antlr/ast/SliceDerived.java
--- a/src/org/python/antlr/ast/SliceDerived.java
+++ b/src/org/python/antlr/ast/SliceDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/StrDerived.java b/src/org/python/antlr/ast/StrDerived.java
--- a/src/org/python/antlr/ast/StrDerived.java
+++ b/src/org/python/antlr/ast/StrDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/SubscriptDerived.java b/src/org/python/antlr/ast/SubscriptDerived.java
--- a/src/org/python/antlr/ast/SubscriptDerived.java
+++ b/src/org/python/antlr/ast/SubscriptDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/SuiteDerived.java b/src/org/python/antlr/ast/SuiteDerived.java
--- a/src/org/python/antlr/ast/SuiteDerived.java
+++ b/src/org/python/antlr/ast/SuiteDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/TryExceptDerived.java b/src/org/python/antlr/ast/TryExceptDerived.java
--- a/src/org/python/antlr/ast/TryExceptDerived.java
+++ b/src/org/python/antlr/ast/TryExceptDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/TryFinallyDerived.java b/src/org/python/antlr/ast/TryFinallyDerived.java
--- a/src/org/python/antlr/ast/TryFinallyDerived.java
+++ b/src/org/python/antlr/ast/TryFinallyDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/TupleDerived.java b/src/org/python/antlr/ast/TupleDerived.java
--- a/src/org/python/antlr/ast/TupleDerived.java
+++ b/src/org/python/antlr/ast/TupleDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/UnaryOpDerived.java b/src/org/python/antlr/ast/UnaryOpDerived.java
--- a/src/org/python/antlr/ast/UnaryOpDerived.java
+++ b/src/org/python/antlr/ast/UnaryOpDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/WhileDerived.java b/src/org/python/antlr/ast/WhileDerived.java
--- a/src/org/python/antlr/ast/WhileDerived.java
+++ b/src/org/python/antlr/ast/WhileDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/WithDerived.java b/src/org/python/antlr/ast/WithDerived.java
--- a/src/org/python/antlr/ast/WithDerived.java
+++ b/src/org/python/antlr/ast/WithDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/YieldDerived.java b/src/org/python/antlr/ast/YieldDerived.java
--- a/src/org/python/antlr/ast/YieldDerived.java
+++ b/src/org/python/antlr/ast/YieldDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/aliasDerived.java b/src/org/python/antlr/ast/aliasDerived.java
--- a/src/org/python/antlr/ast/aliasDerived.java
+++ b/src/org/python/antlr/ast/aliasDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/argumentsDerived.java b/src/org/python/antlr/ast/argumentsDerived.java
--- a/src/org/python/antlr/ast/argumentsDerived.java
+++ b/src/org/python/antlr/ast/argumentsDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/comprehensionDerived.java b/src/org/python/antlr/ast/comprehensionDerived.java
--- a/src/org/python/antlr/ast/comprehensionDerived.java
+++ b/src/org/python/antlr/ast/comprehensionDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/ast/keywordDerived.java b/src/org/python/antlr/ast/keywordDerived.java
--- a/src/org/python/antlr/ast/keywordDerived.java
+++ b/src/org/python/antlr/ast/keywordDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/AddDerived.java b/src/org/python/antlr/op/AddDerived.java
--- a/src/org/python/antlr/op/AddDerived.java
+++ b/src/org/python/antlr/op/AddDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/AndDerived.java b/src/org/python/antlr/op/AndDerived.java
--- a/src/org/python/antlr/op/AndDerived.java
+++ b/src/org/python/antlr/op/AndDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/AugLoadDerived.java b/src/org/python/antlr/op/AugLoadDerived.java
--- a/src/org/python/antlr/op/AugLoadDerived.java
+++ b/src/org/python/antlr/op/AugLoadDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/AugStoreDerived.java b/src/org/python/antlr/op/AugStoreDerived.java
--- a/src/org/python/antlr/op/AugStoreDerived.java
+++ b/src/org/python/antlr/op/AugStoreDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/BitAndDerived.java b/src/org/python/antlr/op/BitAndDerived.java
--- a/src/org/python/antlr/op/BitAndDerived.java
+++ b/src/org/python/antlr/op/BitAndDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/BitOrDerived.java b/src/org/python/antlr/op/BitOrDerived.java
--- a/src/org/python/antlr/op/BitOrDerived.java
+++ b/src/org/python/antlr/op/BitOrDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/BitXorDerived.java b/src/org/python/antlr/op/BitXorDerived.java
--- a/src/org/python/antlr/op/BitXorDerived.java
+++ b/src/org/python/antlr/op/BitXorDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/DelDerived.java b/src/org/python/antlr/op/DelDerived.java
--- a/src/org/python/antlr/op/DelDerived.java
+++ b/src/org/python/antlr/op/DelDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/DivDerived.java b/src/org/python/antlr/op/DivDerived.java
--- a/src/org/python/antlr/op/DivDerived.java
+++ b/src/org/python/antlr/op/DivDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/EqDerived.java b/src/org/python/antlr/op/EqDerived.java
--- a/src/org/python/antlr/op/EqDerived.java
+++ b/src/org/python/antlr/op/EqDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/FloorDivDerived.java b/src/org/python/antlr/op/FloorDivDerived.java
--- a/src/org/python/antlr/op/FloorDivDerived.java
+++ b/src/org/python/antlr/op/FloorDivDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/GtDerived.java b/src/org/python/antlr/op/GtDerived.java
--- a/src/org/python/antlr/op/GtDerived.java
+++ b/src/org/python/antlr/op/GtDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/GtEDerived.java b/src/org/python/antlr/op/GtEDerived.java
--- a/src/org/python/antlr/op/GtEDerived.java
+++ b/src/org/python/antlr/op/GtEDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/InDerived.java b/src/org/python/antlr/op/InDerived.java
--- a/src/org/python/antlr/op/InDerived.java
+++ b/src/org/python/antlr/op/InDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/InvertDerived.java b/src/org/python/antlr/op/InvertDerived.java
--- a/src/org/python/antlr/op/InvertDerived.java
+++ b/src/org/python/antlr/op/InvertDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/IsDerived.java b/src/org/python/antlr/op/IsDerived.java
--- a/src/org/python/antlr/op/IsDerived.java
+++ b/src/org/python/antlr/op/IsDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/IsNotDerived.java b/src/org/python/antlr/op/IsNotDerived.java
--- a/src/org/python/antlr/op/IsNotDerived.java
+++ b/src/org/python/antlr/op/IsNotDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/LShiftDerived.java b/src/org/python/antlr/op/LShiftDerived.java
--- a/src/org/python/antlr/op/LShiftDerived.java
+++ b/src/org/python/antlr/op/LShiftDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/LoadDerived.java b/src/org/python/antlr/op/LoadDerived.java
--- a/src/org/python/antlr/op/LoadDerived.java
+++ b/src/org/python/antlr/op/LoadDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/LtDerived.java b/src/org/python/antlr/op/LtDerived.java
--- a/src/org/python/antlr/op/LtDerived.java
+++ b/src/org/python/antlr/op/LtDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/LtEDerived.java b/src/org/python/antlr/op/LtEDerived.java
--- a/src/org/python/antlr/op/LtEDerived.java
+++ b/src/org/python/antlr/op/LtEDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/ModDerived.java b/src/org/python/antlr/op/ModDerived.java
--- a/src/org/python/antlr/op/ModDerived.java
+++ b/src/org/python/antlr/op/ModDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/MultDerived.java b/src/org/python/antlr/op/MultDerived.java
--- a/src/org/python/antlr/op/MultDerived.java
+++ b/src/org/python/antlr/op/MultDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/NotDerived.java b/src/org/python/antlr/op/NotDerived.java
--- a/src/org/python/antlr/op/NotDerived.java
+++ b/src/org/python/antlr/op/NotDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/NotEqDerived.java b/src/org/python/antlr/op/NotEqDerived.java
--- a/src/org/python/antlr/op/NotEqDerived.java
+++ b/src/org/python/antlr/op/NotEqDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/NotInDerived.java b/src/org/python/antlr/op/NotInDerived.java
--- a/src/org/python/antlr/op/NotInDerived.java
+++ b/src/org/python/antlr/op/NotInDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/OrDerived.java b/src/org/python/antlr/op/OrDerived.java
--- a/src/org/python/antlr/op/OrDerived.java
+++ b/src/org/python/antlr/op/OrDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/ParamDerived.java b/src/org/python/antlr/op/ParamDerived.java
--- a/src/org/python/antlr/op/ParamDerived.java
+++ b/src/org/python/antlr/op/ParamDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/PowDerived.java b/src/org/python/antlr/op/PowDerived.java
--- a/src/org/python/antlr/op/PowDerived.java
+++ b/src/org/python/antlr/op/PowDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/RShiftDerived.java b/src/org/python/antlr/op/RShiftDerived.java
--- a/src/org/python/antlr/op/RShiftDerived.java
+++ b/src/org/python/antlr/op/RShiftDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/StoreDerived.java b/src/org/python/antlr/op/StoreDerived.java
--- a/src/org/python/antlr/op/StoreDerived.java
+++ b/src/org/python/antlr/op/StoreDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/SubDerived.java b/src/org/python/antlr/op/SubDerived.java
--- a/src/org/python/antlr/op/SubDerived.java
+++ b/src/org/python/antlr/op/SubDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/UAddDerived.java b/src/org/python/antlr/op/UAddDerived.java
--- a/src/org/python/antlr/op/UAddDerived.java
+++ b/src/org/python/antlr/op/UAddDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/antlr/op/USubDerived.java b/src/org/python/antlr/op/USubDerived.java
--- a/src/org/python/antlr/op/USubDerived.java
+++ b/src/org/python/antlr/op/USubDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/ClasspathPyImporterDerived.java b/src/org/python/core/ClasspathPyImporterDerived.java
--- a/src/org/python/core/ClasspathPyImporterDerived.java
+++ b/src/org/python/core/ClasspathPyImporterDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/Py.java b/src/org/python/core/Py.java
--- a/src/org/python/core/Py.java
+++ b/src/org/python/core/Py.java
@@ -31,6 +31,7 @@
 import org.python.antlr.base.mod;
 import org.python.core.adapter.ClassicPyObjectAdapter;
 import org.python.core.adapter.ExtensiblePyObjectAdapter;
+import org.python.core.finalization.FinalizeTrigger;
 import org.python.modules.posix.PosixModule;
 import org.python.util.Generic;
 
@@ -2291,7 +2292,7 @@
     public PyObject __call__(PyObject[] args, String[] kws) {
         Object[] margs = new Object[]{args, kws};
         try {
-            return Py.java2py(method.invoke(null, margs));
+        	return Py.java2py(method.invoke(null, margs));
         } catch (Throwable t) {
             throw Py.JavaError(t);
         }
diff --git a/src/org/python/core/PyArrayDerived.java b/src/org/python/core/PyArrayDerived.java
--- a/src/org/python/core/PyArrayDerived.java
+++ b/src/org/python/core/PyArrayDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyBaseExceptionDerived.java b/src/org/python/core/PyBaseExceptionDerived.java
--- a/src/org/python/core/PyBaseExceptionDerived.java
+++ b/src/org/python/core/PyBaseExceptionDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyByteArrayDerived.java b/src/org/python/core/PyByteArrayDerived.java
--- a/src/org/python/core/PyByteArrayDerived.java
+++ b/src/org/python/core/PyByteArrayDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyClass.java b/src/org/python/core/PyClass.java
--- a/src/org/python/core/PyClass.java
+++ b/src/org/python/core/PyClass.java
@@ -190,12 +190,6 @@
         if (__del__ != null) {
         	inst.finalizeTrigger = FinalizeTrigger.makeTrigger(inst);
         }
-//        if (__del__ == null) {
-//            inst = new PyInstance(this);
-//        } else {
-//            // the class defined a __del__ method
-//            inst = new PyFinalizableInstance(this);
-//        }
         inst.__init__(args, keywords);
         return inst;
     }
diff --git a/src/org/python/core/PyClassMethodDerived.java b/src/org/python/core/PyClassMethodDerived.java
--- a/src/org/python/core/PyClassMethodDerived.java
+++ b/src/org/python/core/PyClassMethodDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyComplexDerived.java b/src/org/python/core/PyComplexDerived.java
--- a/src/org/python/core/PyComplexDerived.java
+++ b/src/org/python/core/PyComplexDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyDictionaryDerived.java b/src/org/python/core/PyDictionaryDerived.java
--- a/src/org/python/core/PyDictionaryDerived.java
+++ b/src/org/python/core/PyDictionaryDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyEnumerateDerived.java b/src/org/python/core/PyEnumerateDerived.java
--- a/src/org/python/core/PyEnumerateDerived.java
+++ b/src/org/python/core/PyEnumerateDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyFile.java b/src/org/python/core/PyFile.java
--- a/src/org/python/core/PyFile.java
+++ b/src/org/python/core/PyFile.java
@@ -683,7 +683,7 @@
     }
 
     @Override
-    public void __del__Builtin() {
+    public void __del_builtin__() {
         if (closer != null) {
             closer.close();
         }
diff --git a/src/org/python/core/PyFileDerived.java b/src/org/python/core/PyFileDerived.java
--- a/src/org/python/core/PyFileDerived.java
+++ b/src/org/python/core/PyFileDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyFloatDerived.java b/src/org/python/core/PyFloatDerived.java
--- a/src/org/python/core/PyFloatDerived.java
+++ b/src/org/python/core/PyFloatDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyFrozenSetDerived.java b/src/org/python/core/PyFrozenSetDerived.java
--- a/src/org/python/core/PyFrozenSetDerived.java
+++ b/src/org/python/core/PyFrozenSetDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyGenerator.java b/src/org/python/core/PyGenerator.java
--- a/src/org/python/core/PyGenerator.java
+++ b/src/org/python/core/PyGenerator.java
@@ -112,7 +112,7 @@
     }
     
     @Override
-    public void __del__Builtin() {
+    public void __del_builtin__() {
         if (gi_frame == null || gi_frame.f_lasti == -1) {
             return;
         }
diff --git a/src/org/python/core/PyInstance.java b/src/org/python/core/PyInstance.java
--- a/src/org/python/core/PyInstance.java
+++ b/src/org/python/core/PyInstance.java
@@ -18,6 +18,7 @@
     public static final PyType TYPE = PyType.fromClass(PyInstance.class);
 
     public FinalizeTrigger finalizeTrigger;
+    private static JavaFunc __ensure_finalizer__Function;
 
     // xxx doc, final name
     public transient PyClass instclass;
@@ -29,9 +30,6 @@
 
     public PyInstance() {
         super(TYPE);
-//        if (TYPE.needsFinalizer()) {
-//            finalizeTrigger = FinalizeTrigger.makeTrigger(this);
-//        }
     }
 
     public PyInstance(PyClass iclass, PyObject dict) {
@@ -41,16 +39,10 @@
             dict = new PyStringMap();
         }
         __dict__ = dict;
-//        if (TYPE.needsFinalizer()) {
-//            finalizeTrigger = FinalizeTrigger.makeTrigger(this);
-//        }
     }
 
     public PyInstance(PyClass iclass) {
         this(iclass, null);
-//        if (TYPE.needsFinalizer()) {
-//            finalizeTrigger = FinalizeTrigger.makeTrigger(this);
-//        }
     }
 
     @ExposedNew
@@ -161,9 +153,27 @@
         return ifindfunction(name);
     }
 
+    public static void ensureFinalizer(PyObject[] args, String[] kws) {
+    	FinalizeTrigger.ensureFinalizer((PyInstance) args[0]);
+    }
+    
+    private static JavaFunc makeFunction__ensure_finalizer__() {
+        try {
+            return new JavaFunc(
+                PyInstance.class.getMethod("ensureFinalizer",
+                    PyObject[].class, String[].class));
+        } catch (Exception e) {return null;} //cannot happen
+    }
+
     protected PyObject ifindlocal(String name) {
         if (name == "__dict__") return __dict__;
         if (name == "__class__") return instclass;
+        if (name == "__ensure_finalizer__") {
+            if (__ensure_finalizer__Function == null) {
+            	__ensure_finalizer__Function = makeFunction__ensure_finalizer__();
+            }
+        	return new PyMethod(__ensure_finalizer__Function, this, instclass);
+        }
         if (__dict__ == null) return null;
 
         return __dict__.__finditem__(name);
@@ -1929,17 +1939,6 @@
         return super.__ixor__(o);
     }
 
-    /*
-    public void ensureFinalizer()
-    {
-    	instance_ensureFinalizer();
-    }
-
-    public void instance_ensureFinalizer() {
-        FinalizeTrigger.ensureFinalizer(this);
-    }
-    */
-
     @Override
     public void __del__() {
     	try {
diff --git a/src/org/python/core/PyIntegerDerived.java b/src/org/python/core/PyIntegerDerived.java
--- a/src/org/python/core/PyIntegerDerived.java
+++ b/src/org/python/core/PyIntegerDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyListDerived.java b/src/org/python/core/PyListDerived.java
--- a/src/org/python/core/PyListDerived.java
+++ b/src/org/python/core/PyListDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyLongDerived.java b/src/org/python/core/PyLongDerived.java
--- a/src/org/python/core/PyLongDerived.java
+++ b/src/org/python/core/PyLongDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyModuleDerived.java b/src/org/python/core/PyModuleDerived.java
--- a/src/org/python/core/PyModuleDerived.java
+++ b/src/org/python/core/PyModuleDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyObject.java b/src/org/python/core/PyObject.java
--- a/src/org/python/core/PyObject.java
+++ b/src/org/python/core/PyObject.java
@@ -8,6 +8,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.python.core.finalization.FinalizeTrigger;
 import org.python.expose.ExposedClassMethod;
 import org.python.expose.ExposedDelete;
 import org.python.expose.ExposedGet;
@@ -238,6 +239,12 @@
         return __repr__();
     }
 
+    @ExposedMethod
+    public void __ensure_finalizer__() {
+        //PyObjects that implement HasFinalizeTrigger shall implement this method via:
+    	//FinalizeTrigger.ensureFinalizer(this);
+    }
+
     public PyUnicode __unicode__() {
         return new PyUnicode(__str__());
     }
diff --git a/src/org/python/core/PyObjectDerived.java b/src/org/python/core/PyObjectDerived.java
--- a/src/org/python/core/PyObjectDerived.java
+++ b/src/org/python/core/PyObjectDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyPropertyDerived.java b/src/org/python/core/PyPropertyDerived.java
--- a/src/org/python/core/PyPropertyDerived.java
+++ b/src/org/python/core/PyPropertyDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PySetDerived.java b/src/org/python/core/PySetDerived.java
--- a/src/org/python/core/PySetDerived.java
+++ b/src/org/python/core/PySetDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyStringDerived.java b/src/org/python/core/PyStringDerived.java
--- a/src/org/python/core/PyStringDerived.java
+++ b/src/org/python/core/PyStringDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PySuperDerived.java b/src/org/python/core/PySuperDerived.java
--- a/src/org/python/core/PySuperDerived.java
+++ b/src/org/python/core/PySuperDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyTupleDerived.java b/src/org/python/core/PyTupleDerived.java
--- a/src/org/python/core/PyTupleDerived.java
+++ b/src/org/python/core/PyTupleDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyTypeDerived.java b/src/org/python/core/PyTypeDerived.java
--- a/src/org/python/core/PyTypeDerived.java
+++ b/src/org/python/core/PyTypeDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/PyUnicodeDerived.java b/src/org/python/core/PyUnicodeDerived.java
--- a/src/org/python/core/PyUnicodeDerived.java
+++ b/src/org/python/core/PyUnicodeDerived.java
@@ -19,7 +19,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -27,7 +27,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/core/finalization/FinalizableBuiltin.java b/src/org/python/core/finalization/FinalizableBuiltin.java
--- a/src/org/python/core/finalization/FinalizableBuiltin.java
+++ b/src/org/python/core/finalization/FinalizableBuiltin.java
@@ -6,13 +6,13 @@
 
 public interface FinalizableBuiltin extends HasFinalizeTrigger {
 	/**
-	 * {@code __del__Builtin} is the built-in's own finalizer, while
-	 * {@code __del__Derived} refers to an instance's in-dict {@code __del__}.
-	 * A FinalizeTrigger calls {@code __del__Derived} first and
-     * - if existent - {@code __del__Builtin} after that. A plain {@code __del__}
+	 * {@code __del_builtin__} is the built-in's own finalizer, while
+	 * {@code __del_derived__} refers to an instance's in-dict {@code __del__}.
+	 * A FinalizeTrigger calls {@code __del_derived__} first and
+     * - if existent - {@code __del_builtin__} after that. A plain {@code __del__}
      * would behave as overwritten by {@code __del__Derived}, i.e. won't be called
      * if the type implements {@code FinalizablePyObjectDerived} while
-     * {@code __del__Builtin} is called in any case.
+     * {@code __del_builtin__} is called in any case.
 	 */
-	public void __del__Builtin();
+	public void __del_builtin__();
 }
diff --git a/src/org/python/core/finalization/FinalizablePyObject.java b/src/org/python/core/finalization/FinalizablePyObject.java
--- a/src/org/python/core/finalization/FinalizablePyObject.java
+++ b/src/org/python/core/finalization/FinalizablePyObject.java
@@ -9,17 +9,17 @@
  * <p>
  * The difference is that {@code __del__} can be overwritten by a
  * new-style subclass's {@code __del__}-method on Python-side, while
- * {@code __del__Builtin} is always called. If a Python-side
- * finalizer exists, {@code __del__Builtin} will be called after the
+ * {@code __del_builtin__} is always called. If a Python-side
+ * finalizer exists, {@code __del_builtin__} will be called after the
  * Python-side finalizer has been processed.
  * </p>
  * <p>
  * One can even implement both interfaces.
  * If both interfaces are implemented, the {@code FinalizeTrigger} will
- * call {@code __del__} first and then {@code __del__Builtin}. If a
+ * call {@code __del__} first and then {@code __del_builtin__}. If a
  * new-style subclass has an own, Python-side {@code __del__}-method, this
  * overwrites the Java-implemented {@code __del__}, but not
- * {@code __del__Builtin}, which will be called after the Python-side
+ * {@code __del_builtin__}, which will be called after the Python-side
  * finalizer.
  * </p>
  * <p>
@@ -60,14 +60,14 @@
  *    If your finalizer resurrects the object (Python allows this) and you wish the
  *    finalizer to run again on next collection of the object:</br>
  *    In the block where the resurrection occurs, let your {@code __del__}- or
- *    {@code __del__Builtin}-method call<br>
+ *    {@code __del_builtin__}-method call<br>
  *    {@code FinalizeTrigger.ensureFinalizer(this);}.
  * </li>
  * </ol>
  * </p>
  * <p>
  * Note: Regarding to object resurrection, Jython currently behaves like CPython >= 3.4.
- * That means the finalizer {@code __del__} or {@code __del__Builtin} is called only the
+ * That means the finalizer {@code __del__} or {@code __del_builtin__} is called only the
  * first time an object gets gc'ed. If pre 3.4. behavior is required for some reason (i.e.
  * have the finalizer called repeatedly on every collection after a resurrection), one can
  * achieve this manually via step 5).
@@ -75,7 +75,7 @@
  * <p>
  * It is possible to switch finalization on and off at any desired time for a certain object.
  * This can be helpful if it is only necessary to have {@code __del__} or
- * {@code __del__Builtin} called for certain configurations of an object.
+ * {@code __del_builtin__} called for certain configurations of an object.
  * </p>
  * <p>
  * To turn off the finalizer, call</br>
diff --git a/src/org/python/core/finalization/FinalizablePyObjectDerived.java b/src/org/python/core/finalization/FinalizablePyObjectDerived.java
--- a/src/org/python/core/finalization/FinalizablePyObjectDerived.java
+++ b/src/org/python/core/finalization/FinalizablePyObjectDerived.java
@@ -11,13 +11,13 @@
 public interface FinalizablePyObjectDerived extends HasFinalizeTrigger {
 	
 	/**
-	 * {@code __del__Builtin} is the built-in's own finalizer, while
-	 * {@code __del__Derived} refers to an instance's in-dict {@code __del__}.
-	 * A FinalizeTrigger calls {@code __del__Derived} first and
-     * - if existent - {@code __del__Builtin} after that. A plain {@code __del__}
-     * would behave as overwritten by {@code __del__Derived}, i.e. won't be called
+	 * {@code __del_builtin__} is the built-in's own finalizer, while
+	 * {@code __del_derived__} refers to an instance's in-dict {@code __del__}.
+	 * A FinalizeTrigger calls {@code __del_derived__} first and
+     * - if existent - {@code __del_builtin__} after that. A plain {@code __del__}
+     * would behave as overwritten by {@code __del_derived__}, i.e. won't be called
      * if the type implements {@code FinalizablePyObjectDerived} while
-     * {@code __del__Builtin} is called in any case.
+     * {@code __del_builtin__} is called in any case.
 	 */
-	public void __del__Derived();
+	public void __del_derived__();
 }
diff --git a/src/org/python/core/finalization/FinalizeTrigger.java b/src/org/python/core/finalization/FinalizeTrigger.java
--- a/src/org/python/core/finalization/FinalizeTrigger.java
+++ b/src/org/python/core/finalization/FinalizeTrigger.java
@@ -1,10 +1,6 @@
 package org.python.core.finalization;
 
 import java.lang.reflect.Field;
-import java.lang.ref.WeakReference;
-import java.lang.ref.SoftReference;
-import java.lang.ref.Reference;
-import org.python.core.PyObject;
 
 /**
  * To use finalizers on {@code PyObject}s, read the documentation of
@@ -26,16 +22,6 @@
         }
     }
 
-    /*
-    public static FinalizeTrigger makeTriggerDerived(FinalizablePyObjectDerived toFinalize) {
-        if (factory != null) {
-            return factory.makeTriggerDerived(toFinalize);
-        } else {
-            return new FinalizeTriggerDerived(toFinalize);
-        }
-    }
-    */
-
     /**
      * Recreates the {@code FinalizeTrigger} of the given object. This makes sure that
      * once the resurrected object is gc'ed again, its {@code __del__}-method will be
@@ -46,12 +32,6 @@
     	setFinalizeTrigger(resurrect, trigger);
     }
 
-    /*
-    public static void ensureFinalizerDerived(FinalizablePyObjectDerived resurrect) {
-        setFinalizeTrigger(resurrect, makeTriggerDerived(resurrect));
-    }
-    */
-
     public static void setFinalizeTrigger(HasFinalizeTrigger toFinalize, FinalizeTrigger trigger) {
         Field triggerField;
         try {
@@ -92,6 +72,7 @@
 
 
     protected HasFinalizeTrigger toFinalize;
+
     public void clear() {
         toFinalize = null;
     }
@@ -108,31 +89,13 @@
     protected void finalize() throws Throwable {
         if (toFinalize != null) {
         	if (toFinalize instanceof FinalizablePyObjectDerived) {
-        		((FinalizablePyObjectDerived) toFinalize).__del__Derived();
+        		((FinalizablePyObjectDerived) toFinalize).__del_derived__();
         	} else if (toFinalize instanceof FinalizablePyObject) {
         		((FinalizablePyObject) toFinalize).__del__();
         	}
         	if (toFinalize instanceof FinalizableBuiltin) {
-        		((FinalizableBuiltin) toFinalize).__del__Builtin();
+        		((FinalizableBuiltin) toFinalize).__del_builtin__();
         	}
         }
     }
-
-
-    /*
-     * A FinalizeTrigger variant that only calls __del__Derived, but not the
-     * built-in's finalizer __del__. It can be used to control finalization
-     * behavior of resurrected objects in more detail.
-     */
-    /*protected static class FinalizeTriggerDerived extends FinalizeTrigger {
-    	protected FinalizeTriggerDerived(FinalizablePyObjectDerived toFinalize) {
-            super(toFinalize);
-        }
-
-        protected void finalize() throws Throwable {
-            if (toFinalize != null) {
-            	((FinalizablePyObjectDerived) toFinalize).__del__Derived();
-            }
-        }
-    }*/
 }
diff --git a/src/org/python/modules/PyStructDerived.java b/src/org/python/modules/PyStructDerived.java
--- a/src/org/python/modules/PyStructDerived.java
+++ b/src/org/python/modules/PyStructDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_collections/PyDefaultDictDerived.java b/src/org/python/modules/_collections/PyDefaultDictDerived.java
--- a/src/org/python/modules/_collections/PyDefaultDictDerived.java
+++ b/src/org/python/modules/_collections/PyDefaultDictDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_collections/PyDequeDerived.java b/src/org/python/modules/_collections/PyDequeDerived.java
--- a/src/org/python/modules/_collections/PyDequeDerived.java
+++ b/src/org/python/modules/_collections/PyDequeDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_csv/PyDialectDerived.java b/src/org/python/modules/_csv/PyDialectDerived.java
--- a/src/org/python/modules/_csv/PyDialectDerived.java
+++ b/src/org/python/modules/_csv/PyDialectDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_functools/PyPartialDerived.java b/src/org/python/modules/_functools/PyPartialDerived.java
--- a/src/org/python/modules/_functools/PyPartialDerived.java
+++ b/src/org/python/modules/_functools/PyPartialDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_io/PyFileIODerived.java b/src/org/python/modules/_io/PyFileIODerived.java
--- a/src/org/python/modules/_io/PyFileIODerived.java
+++ b/src/org/python/modules/_io/PyFileIODerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_io/PyIOBase.java b/src/org/python/modules/_io/PyIOBase.java
--- a/src/org/python/modules/_io/PyIOBase.java
+++ b/src/org/python/modules/_io/PyIOBase.java
@@ -732,7 +732,7 @@
     }
 
     @Override
-    public void __del__Builtin() {
+    public void __del_builtin__() {
         closer.dismiss();
         invoke("close");
     }
diff --git a/src/org/python/modules/_io/PyIOBaseDerived.java b/src/org/python/modules/_io/PyIOBaseDerived.java
--- a/src/org/python/modules/_io/PyIOBaseDerived.java
+++ b/src/org/python/modules/_io/PyIOBaseDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_io/PyRawIOBaseDerived.java b/src/org/python/modules/_io/PyRawIOBaseDerived.java
--- a/src/org/python/modules/_io/PyRawIOBaseDerived.java
+++ b/src/org/python/modules/_io/PyRawIOBaseDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/_weakref/ReferenceTypeDerived.java b/src/org/python/modules/_weakref/ReferenceTypeDerived.java
--- a/src/org/python/modules/_weakref/ReferenceTypeDerived.java
+++ b/src/org/python/modules/_weakref/ReferenceTypeDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/bz2/PyBZ2CompressorDerived.java b/src/org/python/modules/bz2/PyBZ2CompressorDerived.java
--- a/src/org/python/modules/bz2/PyBZ2CompressorDerived.java
+++ b/src/org/python/modules/bz2/PyBZ2CompressorDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/bz2/PyBZ2DecompressorDerived.java b/src/org/python/modules/bz2/PyBZ2DecompressorDerived.java
--- a/src/org/python/modules/bz2/PyBZ2DecompressorDerived.java
+++ b/src/org/python/modules/bz2/PyBZ2DecompressorDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/bz2/PyBZ2File.java b/src/org/python/modules/bz2/PyBZ2File.java
--- a/src/org/python/modules/bz2/PyBZ2File.java
+++ b/src/org/python/modules/bz2/PyBZ2File.java
@@ -76,7 +76,7 @@
     }
 
     @Override
-    public void __del__Builtin() {
+    public void __del_builtin__() {
         BZ2File_close();
     }
 
diff --git a/src/org/python/modules/bz2/PyBZ2FileDerived.java b/src/org/python/modules/bz2/PyBZ2FileDerived.java
--- a/src/org/python/modules/bz2/PyBZ2FileDerived.java
+++ b/src/org/python/modules/bz2/PyBZ2FileDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/PyTeeIteratorDerived.java b/src/org/python/modules/itertools/PyTeeIteratorDerived.java
--- a/src/org/python/modules/itertools/PyTeeIteratorDerived.java
+++ b/src/org/python/modules/itertools/PyTeeIteratorDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/chainDerived.java b/src/org/python/modules/itertools/chainDerived.java
--- a/src/org/python/modules/itertools/chainDerived.java
+++ b/src/org/python/modules/itertools/chainDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/combinationsDerived.java b/src/org/python/modules/itertools/combinationsDerived.java
--- a/src/org/python/modules/itertools/combinationsDerived.java
+++ b/src/org/python/modules/itertools/combinationsDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/combinationsWithReplacementDerived.java b/src/org/python/modules/itertools/combinationsWithReplacementDerived.java
--- a/src/org/python/modules/itertools/combinationsWithReplacementDerived.java
+++ b/src/org/python/modules/itertools/combinationsWithReplacementDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/compressDerived.java b/src/org/python/modules/itertools/compressDerived.java
--- a/src/org/python/modules/itertools/compressDerived.java
+++ b/src/org/python/modules/itertools/compressDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/countDerived.java b/src/org/python/modules/itertools/countDerived.java
--- a/src/org/python/modules/itertools/countDerived.java
+++ b/src/org/python/modules/itertools/countDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/cycleDerived.java b/src/org/python/modules/itertools/cycleDerived.java
--- a/src/org/python/modules/itertools/cycleDerived.java
+++ b/src/org/python/modules/itertools/cycleDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/dropwhileDerived.java b/src/org/python/modules/itertools/dropwhileDerived.java
--- a/src/org/python/modules/itertools/dropwhileDerived.java
+++ b/src/org/python/modules/itertools/dropwhileDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/groupbyDerived.java b/src/org/python/modules/itertools/groupbyDerived.java
--- a/src/org/python/modules/itertools/groupbyDerived.java
+++ b/src/org/python/modules/itertools/groupbyDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/ifilterDerived.java b/src/org/python/modules/itertools/ifilterDerived.java
--- a/src/org/python/modules/itertools/ifilterDerived.java
+++ b/src/org/python/modules/itertools/ifilterDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/ifilterfalseDerived.java b/src/org/python/modules/itertools/ifilterfalseDerived.java
--- a/src/org/python/modules/itertools/ifilterfalseDerived.java
+++ b/src/org/python/modules/itertools/ifilterfalseDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/isliceDerived.java b/src/org/python/modules/itertools/isliceDerived.java
--- a/src/org/python/modules/itertools/isliceDerived.java
+++ b/src/org/python/modules/itertools/isliceDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/izipDerived.java b/src/org/python/modules/itertools/izipDerived.java
--- a/src/org/python/modules/itertools/izipDerived.java
+++ b/src/org/python/modules/itertools/izipDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/izipLongestDerived.java b/src/org/python/modules/itertools/izipLongestDerived.java
--- a/src/org/python/modules/itertools/izipLongestDerived.java
+++ b/src/org/python/modules/itertools/izipLongestDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/permutationsDerived.java b/src/org/python/modules/itertools/permutationsDerived.java
--- a/src/org/python/modules/itertools/permutationsDerived.java
+++ b/src/org/python/modules/itertools/permutationsDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/productDerived.java b/src/org/python/modules/itertools/productDerived.java
--- a/src/org/python/modules/itertools/productDerived.java
+++ b/src/org/python/modules/itertools/productDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/repeatDerived.java b/src/org/python/modules/itertools/repeatDerived.java
--- a/src/org/python/modules/itertools/repeatDerived.java
+++ b/src/org/python/modules/itertools/repeatDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/starmapDerived.java b/src/org/python/modules/itertools/starmapDerived.java
--- a/src/org/python/modules/itertools/starmapDerived.java
+++ b/src/org/python/modules/itertools/starmapDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/itertools/takewhileDerived.java b/src/org/python/modules/itertools/takewhileDerived.java
--- a/src/org/python/modules/itertools/takewhileDerived.java
+++ b/src/org/python/modules/itertools/takewhileDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/random/PyRandomDerived.java b/src/org/python/modules/random/PyRandomDerived.java
--- a/src/org/python/modules/random/PyRandomDerived.java
+++ b/src/org/python/modules/random/PyRandomDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/thread/PyLocalDerived.java b/src/org/python/modules/thread/PyLocalDerived.java
--- a/src/org/python/modules/thread/PyLocalDerived.java
+++ b/src/org/python/modules/thread/PyLocalDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/org/python/modules/zipimport/zipimporterDerived.java b/src/org/python/modules/zipimport/zipimporterDerived.java
--- a/src/org/python/modules/zipimport/zipimporterDerived.java
+++ b/src/org/python/modules/zipimport/zipimporterDerived.java
@@ -20,7 +20,7 @@
 
     private PyObject[]slots;
 
-    public void __del__Derived() {
+    public void __del_derived__() {
         PyType self_type=getType();
         PyObject impl=self_type.lookup("__del__");
         if (impl!=null) {
@@ -28,7 +28,7 @@
         }
     }
 
-    public void ensureFinalizer() {
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/templates/gderived-defs b/src/templates/gderived-defs
--- a/src/templates/gderived-defs
+++ b/src/templates/gderived-defs
@@ -20,15 +20,15 @@
     
     private PyObject[] slots;
     
-    public void __del__Derived() {
+    public void __del_derived__() {
     	PyType self_type = getType();
         PyObject impl = self_type.lookup("__del__");
         if (impl != null) {
             impl.__get__(this, self_type).__call__();
         }
     }
-    
-    public void ensureFinalizer() {
+
+    public void __ensure_finalizer__() {
         FinalizeTrigger.ensureFinalizer(this);
     }
 
diff --git a/src/templates/object.derived b/src/templates/object.derived
--- a/src/templates/object.derived
+++ b/src/templates/object.derived
@@ -431,4 +431,3 @@
       }
       return super.__coerce_ex__(o);
   }
-

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list