

def __init__(self, name, length=None, decimalCount=None, start=None, stop=None, ignoreErrors=False):
    'Initialize instance.'
    assert (self.typeCode is not None), 'Type code must be overriden'
    assert (self.defaultValue is not None), 'Default value must be overriden'
    if (len(name) > 10):
        raise ValueError(('Field name "%s" is too long' % name))
    name = str(name).upper()
    if (self.__class__.length is None):
        if (length is None):
            raise ValueError(("[%s] Length isn't specified" % name))
        length = int(length)
        if (length <= 0):
            raise ValueError(('[%s] Length must be a positive integer' % name))
    else:
        length = self.length
    if (decimalCount is None):
        decimalCount = 0
    self.name = name
    self.length = length
    self.decimalCount = decimalCount
    self.ignoreErrors = ignoreErrors
    self.start = start
    self.end = stop

dataset/ETHPy150Open kennethreitz/tablib/tablib/packages/dbfpy3/fields.py DbfFieldDef.__init__/original