Next / Previous / Contents / Shipman's homepage

12.2. BirdForm.__getitem__(): Index function

This function retrieves the nth sighting in self, or raises KeyError otherwise.

birdnotes.py
# - - -   B i r d F o r m . _ _ g e t i t e m _ _

    def __getitem__(self, n):
        """Return the (n)th sighting in self
        """
        return  self._sightingList[n]