def test_cons_slicing():
    cons = HyCons("car", "cdr")
    assert cons[0] == "car"
    assert cons[1:] == "cdr"
    try:
        cons[:]
        assert True is False
    except IndexError:
        pass

    try:
        cons[1]
        assert True is False
    except IndexError:
        pass
Check that cons slicing works as expected
dataset/ETHPy150Open hylang/hy/tests/models/test_cons.py/test_cons_slicing