def chunkCount(self):
        """Returns the number of chunks in the level. May initiate a costly
        chunk scan."""
        if self._allChunks is None:
            self.preloadChunkPositions()
        return len(self._allChunks)
Returns the number of chunks in the level. May initiate a costly
        chunk scan.
pymclevel/infiniteworld.py