An object of this class represents one station.
# - - - - - c l a s s S t a t i o n - - - - -
class Station:
'''Represents one banding station in a given location.
Exports:
Station(loc, staNo, staName, staCode):
[ (loc is a Location object) and
(staNo is a station number as a string) and
(staName is a station name) and
(staCode is an alphabetic station code) ->
return a new Station with those attributes ]
.loc: [ as passed to constructor, read-only ]
.staNo: [ as passed to constructor, read-only ]
.staName: [ as passed to constructor, read-only ]
.staCode: [ as passed to constructor, read-only ]
.__str__(self):
[ return a string representation of self ]
'''
All the constructor has to do is save its arguments.
# - - - S t a t i o n . _ _ i n i t _ _ - - -
def __init__(self, loc, staNo, staName, staCode):
'''Constructor for Station.
'''
self.loc = loc
self.staNo = staNo
self.staName = staName
self.staCode = staCode
The last three lines set the corresponding attributes to
empty strings in case the arguments have the default values
(None).