本文整理汇总了Python中pypy.jit.metainterp.warmstate.WarmEnterState.make_unwrap_greenkey方法的典型用法代码示例。如果您正苦于以下问题:Python WarmEnterState.make_unwrap_greenkey方法的具体用法?Python WarmEnterState.make_unwrap_greenkey怎么用?Python WarmEnterState.make_unwrap_greenkey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.jit.metainterp.warmstate.WarmEnterState
的用法示例。
在下文中一共展示了WarmEnterState.make_unwrap_greenkey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_make_unwrap_greenkey
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_unwrap_greenkey [as 别名]
def test_make_unwrap_greenkey():
class FakeWarmRunnerDesc:
green_args_spec = [lltype.Signed, lltype.Float]
state = WarmEnterState(FakeWarmRunnerDesc())
unwrap_greenkey = state.make_unwrap_greenkey()
greenargs = unwrap_greenkey([ConstInt(42), ConstFloat(42.5)])
assert greenargs == (42, 42.5)
assert type(greenargs[0]) is int
示例2: test_make_unwrap_greenkey
# 需要导入模块: from pypy.jit.metainterp.warmstate import WarmEnterState [as 别名]
# 或者: from pypy.jit.metainterp.warmstate.WarmEnterState import make_unwrap_greenkey [as 别名]
def test_make_unwrap_greenkey():
class FakeJitDriverSD:
_green_args_spec = [lltype.Signed, lltype.Float]
state = WarmEnterState(None, FakeJitDriverSD())
unwrap_greenkey = state.make_unwrap_greenkey()
greenargs = unwrap_greenkey([ConstInt(42), constfloat(42.5)])
assert greenargs == (42, 42.5)
assert type(greenargs[0]) is int