Lines Matching refs:hf
278 hf = hasfields()
279 hf.x = 1
280 assert.eq(hf.x, 1)
281 hf.x = [1, 2]
282 hf.x += [3, 4]
283 assert.eq(hf.x, [1, 2, 3, 4])
284 freeze(hf)
285 def setX(hf):
286 hf.x = 2
287 def setY(hf):
288 hf.y = 3
289 assert.fails(lambda: setX(hf), "cannot set field on a frozen hasfields")
290 assert.fails(lambda: setY(hf), "cannot set field on a frozen hasfields")