def __init__(self, data):
    self._data = []
    self._current_pos = 0
    if (not isinstance(data, basestring)):
        raise NexusError('The coding data given to a StandardData object should be a string')
    multi_coding = False
    uncertain_coding = False
    coding_list = {'t': 'std', 'd': []}
    for (pos, coding) in enumerate(data):
        if multi_coding:
            if (coding == ')'):
                multi_coding = False
            else:
                coding_list['d'].append(coding)
                continue
        elif uncertain_coding:
            if (coding == '}'):
                uncertain_coding = False
            else:
                coding_list['d'].append(coding)
                continue
        elif (coding == '('):
            multi_coding = True
            coding_list['t'] = 'multi'
            continue
        elif (coding == '{'):
            uncertain_coding = True
            coding_list['t'] = 'uncer'
            continue
        elif (coding in [')', '}']):
            raise NexusError((((('Improper character "' + coding) + '" at position ') + pos) + ' of a coding sequence.'))
        else:
            coding_list['d'].append(coding)
        self._data.append(coding_list.copy())
        coding_list = {'t': 'std', 'd': []}
def __init__(self, data):
    self._data = []
    self._current_pos = 0
    if (not isinstance(data, basestring)):
        raise NexusError('The coding data given to a StandardData object should be a string')
    multi_coding = False
    uncertain_coding = False
    coding_list = {'t': 'std', 'd': []}
    for (pos, coding) in enumerate(data):
        if multi_coding:
            if (coding == ')'):
                multi_coding = False
            else:
                coding_list['d'].append(coding)
                continue
        elif uncertain_coding:
            if (coding == '}'):
                uncertain_coding = False
            else:
                coding_list['d'].append(coding)
                continue
        elif (coding == '('):
            multi_coding = True
            coding_list['t'] = 'multi'
            continue
        elif (coding == '{'):
            uncertain_coding = True
            coding_list['t'] = 'uncer'
            continue
        elif (coding in [')', '}']):
            raise NexusError((((('Improper character "' + coding) + '" at position ') + pos) + ' of a coding sequence.'))
        else:
            coding_list['d'].append(coding)
        self._data.append(coding_list.copy())
        coding_list = {'t': 'std', 'd': []}