You can merge these three ``has_neighbors``.  The second argument can be a tuple of types or classes (since it is passed to ```isinstance``).