An object of this class represents the sex code. It is very
similar to Section 36, “class AgeCodeField: Age code”, except for the
list of valid codes; see the specification.
class SexCodeField(SingleField):
'''Represents a sex code.
Exports: as inherited.
'''
Next we define the class attributes required by the SingleField interface. These define the set of valid
sex codes, and a translation table that maps the older sex
codes onto the newer set. Note that VALID_CODES
does not contain a space character, because the sex code is
required.
VALID_CODES = "UMFX"
OLD_TRANSLATOR = string.maketrans (
"045",
"UMF")