

def test_issue_4149():
    assert (3 + I).is_complex
    assert ((3 + I).is_imaginary is False)
    assert ((3 * I) + (S.Pi * I)).is_imaginary
    y = Symbol('y', real=True)
    assert ((((3 * I) + (S.Pi * I)) + (y * I)).is_imaginary is None)
    p = Symbol('p', positive=True)
    assert (((3 * I) + (S.Pi * I)) + (i * I)).is_imaginary
    n = Symbol('n', negative=True)
    assert ((((- 3) * I) - (S.Pi * I)) + (n * I)).is_imaginary
    i = Symbol('i', imaginary=True)
    assert ([(i ** a).is_imaginary for a in range(4)] == [False, True, False, True])
    e = S('-sqrt(3)*I/2 + 0.866025403784439*I')
    assert (e.is_real is False)
    assert e.is_imaginary

dataset/ETHPy150Open sympy/sympy/sympy/core/tests/test_assumptions.py test_issue_4149/VarMisuse@122/136 `p`->`i`