Next / Previous / Contents / Shipman's homepage

9.5. Taxon.__getitem__()

This method is called whenever a Taxon item T is indexed as T[i]. It returns the ith child taxon of self if there is one; otherwise it raises KeyError.

xnomo3.py
# - - -   T a x o n . _ _ g e t i t e m _ _   - - -

    def __getitem__ ( self, n ):
        """Get the nth child taxon of self.
        """
        return self.__childList[n]