from__future__importprint_functionclassC:defcompiled_method(self):returnselfdefcalledRepeatedly():inst=C()# This is supposed to make a call to a compiled method, which is# being optimized separately.# construct_begininst.compiled_method()inst.compiled_method()inst.compiled_method()# construct_alternativeimportitertoolsforxinitertools.repeat(None,50000):calledRepeatedly()print("OK.")
from__future__importprint_functionclassC:defcompiled_method(self):returnselfdefcalledRepeatedly():inst=C()# This is supposed to make a call to a compiled method, which is# being optimized separately.# construct_begin# construct_alternativepass# construct_endimportitertoolsforxinitertools.repeat(None,50000):calledRepeatedly()print("OK.")