def _construct_simple(coeffs, opt):
    'Handle simple domains, e.g.: ZZ, QQ, RR and algebraic domains. '
    (result, rationals, reals, algebraics) = ({}, False, False, False)
    if (opt.extension is True):
        is_algebraic = (lambda coeff: ask(Q.algebraic(coeff)))
    else:
        is_algebraic = (lambda coeff: False)
    for coeff in coeffs:
        if coeff.is_Rational:
            if (not coeff.is_Integer):
                rationals = True
        elif coeff.is_Float:
            if (not algebraics):
                reals = True
            else:
                return False
        elif is_algebraic(coeff):
            if (not reals):
                algebraics = True
            else:
                return False
        else:
            return None
    if algebraics:
        (domain, result) = _construct_algebraic(coeffs, opt)
    else:
        if reals:
            domain = RR
        elif (opt.field or rationals):
            domain = QQ
        else:
            domain = ZZ
        result = []
        for coeff in coeffs:
            result.append(domain.from_sympy(coeff))
    return (domain, result)
Handle simple domains, e.g.: ZZ, QQ, RR and algebraic domains.
def _construct_simple(coeffs, opt):
    ' '
    (result, rationals, reals, algebraics) = ({}, False, False, False)
    if (opt.extension is True):
        is_algebraic = (lambda coeff: ask(Q.algebraic(coeff)))
    else:
        is_algebraic = (lambda coeff: False)
    for coeff in coeffs:
        if coeff.is_Rational:
            if (not coeff.is_Integer):
                rationals = True
        elif coeff.is_Float:
            if (not algebraics):
                reals = True
            else:
                return False
        elif is_algebraic(coeff):
            if (not reals):
                algebraics = True
            else:
                return False
        else:
            return None
    if algebraics:
        (domain, result) = _construct_algebraic(coeffs, opt)
    else:
        if reals:
            domain = RR
        elif (opt.field or rationals):
            domain = QQ
        else:
            domain = ZZ
        result = []
        for coeff in coeffs:
            result.append(domain.from_sympy(coeff))
    return (domain, result)