本文整理汇总了Python中pypy.interpreter.argument.Arguments.unmatch_signature方法的典型用法代码示例。如果您正苦于以下问题:Python Arguments.unmatch_signature方法的具体用法?Python Arguments.unmatch_signature怎么用?Python Arguments.unmatch_signature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.interpreter.argument.Arguments
的用法示例。
在下文中一共展示了Arguments.unmatch_signature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unmatch_signature
# 需要导入模块: from pypy.interpreter.argument import Arguments [as 别名]
# 或者: from pypy.interpreter.argument.Arguments import unmatch_signature [as 别名]
def test_unmatch_signature(self):
space = DummySpace()
args = Arguments(space, [1, 2, 3])
sig = (["a", "b", "c"], None, None)
data = args.match_signature(sig, [])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1])
sig = (["a", "b", "c"], None, None)
data = args.match_signature(sig, [2, 3])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1, 2, 3, 4, 5])
sig = (["a", "b", "c"], "r", None)
data = args.match_signature(sig, [])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1], {"c": 3, "b": 2})
sig = (["a", "b", "c"], None, None)
data = args.match_signature(sig, [])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1], {"c": 5})
sig = (["a", "b", "c"], None, None)
data = args.match_signature(sig, [2, 3])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1], {"c": 5, "d": 7})
sig = (["a", "b", "c"], None, "kw")
data = args.match_signature(sig, [2, 3])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1, 2, 3, 4, 5], {"e": 5, "d": 7})
sig = (["a", "b", "c"], "r", "kw")
data = args.match_signature(sig, [2, 3])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [], {}, w_stararg=[1], w_starstararg={"c": 5, "d": 7})
sig = (["a", "b", "c"], None, "kw")
data = args.match_signature(sig, [2, 3])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()
args = Arguments(space, [1, 2], {"g": 9}, w_stararg=[3, 4, 5], w_starstararg={"e": 5, "d": 7})
sig = (["a", "b", "c"], "r", "kw")
data = args.match_signature(sig, [2, 3])
new_args = args.unmatch_signature(sig, data)
assert args.unpack() == new_args.unpack()