def test_cons_replacing():
 cons = HyCons('foo', 'bar')
 cons[0] = 'car'
 assert (cons == HyCons('car', 'bar'))
 cons[1:] = 'cdr'
 assert (cons == HyCons('car', 'cdr'))
 try:
  cons[:] = 'foo'
  assert (True is False)
 except IndexError:
  pass

def test_cons_replacing ( ) : cons = HyCons ( 'foo' , 'bar' ) cons [ 0 ] = 'car' assert ( cons == HyCons ( 'car' , 'bar' ) ) cons [ 1 : ] = 'cdr' assert ( cons == HyCons ( 'car' , 'cdr' ) ) try : cons [ : ] = 'foo' assert ( True is False ) except IndexError : pass
check that assigning to a cons works as expected .