[pypy-svn] r13132 - pypy/dist/pypy/rpython
pedronis at codespeak.net
pedronis at codespeak.net
Tue Jun 7 01:55:51 CEST 2005
Author: pedronis
Date: Tue Jun 7 01:55:50 2005
New Revision: 13132
Modified:
pypy/dist/pypy/rpython/lltype.py
Log:
refactoring
Modified: pypy/dist/pypy/rpython/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltype.py (original)
+++ pypy/dist/pypy/rpython/lltype.py Tue Jun 7 01:55:50 2005
@@ -497,9 +497,12 @@
value = typ._defl()
setattr(self, fld, value)
if parent is not None:
- self._parent_type = typeOf(parent)
- self._wrparent = weakref.ref(parent)
- self._parent_index = parentindex
+ self._setparentstructure(parent, parentindex)
+
+ def _setparentstructure(self, parent, parentindex):
+ self._wrparent = weakref.ref(parent)
+ self._parent_type = typeOf(parent)
+ self._parent_index = parentindex
def _parentstructure(self):
if self._wrparent is not None:
@@ -545,9 +548,12 @@
self.items = [TYPE.OF._defl(parent=self, parentindex=j)
for j in range(n)]
if parent is not None:
- self._parent_type = typeOf(parent)
- self._wrparent = weakref.ref(parent)
- self._parent_index = parentindex
+ self._setparentstructure(parent, parentindex)
+
+ def _setparentstructure(self, parent, parentindex):
+ self._wrparent = weakref.ref(parent)
+ self._parent_type = typeOf(parent)
+ self._parent_index = parentindex
def _parentstructure(self):
if self._wrparent is not None:
More information about the Pypy-commit
mailing list