Next / Previous / Contents / Shipman's homepage

8.4. DayNotes.lookupLoc(): Look up a location code

This method passes the request through to the method of the same name in the DaySummary class; see Section 9.4, “DaySummary.lookupLoc(): Find a location by its code”. You might ask, why can't a user of this class just use the DayNotes.daySummary attribute's .lookupLoc() method? We can't because that would violate the Law of Demeter.

birdnotes.py
# - - -   D a y N o t e s . l o o k u p L o c

    def lookupLoc(self, locCode):
        """Lookup a location code, return a Loc instance.
        """
        return  self.daySummary.lookupLoc(locCode)