'Do not store fields in _converted if one of its bases is self,
or if it has a common base with self.
This results in a reference cycle that cannot be broken since
ndarrays do not participate in cyclic garbage collection.'

def _cache_field(self, name, field):

    base = field
    while True:
        self_base = self
        while True:
            if (self_base is base):
                return
            if (getattr(self_base, 'base', None) is not None):
                self_base = self_base.base
            else:
                break
        if (getattr(base, 'base', None) is not None):
            base = base.base
        else:
            break
    self._converted[name] = field
