当前位置: 首页>>代码示例>>Python>>正文


Python signature.is_signature_compatible函数代码示例

本文整理汇总了Python中pydenji.ducktypes.signature.is_signature_compatible函数的典型用法代码示例。如果您正苦于以下问题:Python is_signature_compatible函数的具体用法?Python is_signature_compatible怎么用?Python is_signature_compatible使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_signature_compatible函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _verify_special_methods

    def _verify_special_methods(self, someobj):
        someobj_special_methods = self._fetch_special_methods(someobj)
        our_special_methods = self._fetch_special_methods(self.reference_obj)

        missing = set(our_special_methods).difference(set(someobj_special_methods))
        if missing:
            # someobj is lacking some method we need
            raise SignatureVerificationError, "%s lacks methods: %s" % (someobj, missing)

        for name, method in our_special_methods.items():
            if not is_signature_compatible(method, someobj_special_methods[name]):
                raise SignatureVerificationError, "%s signature for %s is incompatible" % (someobj, method)
开发者ID:alanfranz,项目名称:pydenji,代码行数:12,代码来源:ducktype.py

示例2: test_two_fixed_args_incompatible_three_args_varargs

 def test_two_fixed_args_incompatible_three_args_varargs(self):
     self.assertEquals(False, is_signature_compatible(two_arg_callable1, three_args_varargs_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例3: test_kwargs_compatible_with_optarg_kwargs

 def test_kwargs_compatible_with_optarg_kwargs(self):
     self.assertEquals(True, is_signature_compatible(all_kwargs_callable, optarg_kwargs_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例4: test_arg_optarg_kwargs_callable_compatible_with_mixed_everything_callable

 def test_arg_optarg_kwargs_callable_compatible_with_mixed_everything_callable(self):
     self.assertEquals(True, is_signature_compatible(arg_optarg_kwargs_callable, mixed_everything_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例5: test_vararg_kwargs_incompatible_with_everything_but_itself

 def test_vararg_kwargs_incompatible_with_everything_but_itself(self):
     everything_but_varargs_kwargs_callable = filter(lambda x: x.func_name != "varargs_kwargs_callable", everything)
     for func in everything_but_varargs_kwargs_callable:
         self.assertEquals(False, is_signature_compatible(varargs_kwargs_callable, func), "%s is compatible!" % func.func_name)
开发者ID:alanfranz,项目名称:pydenji,代码行数:4,代码来源:test_signature.py

示例6: test_unboundmethod_signature_is_not_compatible_with_instancemeth

 def test_unboundmethod_signature_is_not_compatible_with_instancemeth(self):
     self.assertFalse(is_signature_compatible(DifferentMethods.instancemeth, self.obj.instancemeth))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例7: test_attrfunc_signature_is_compatible_with_instancemeth

 def test_attrfunc_signature_is_compatible_with_instancemeth(self):
     self.assertTrue(is_signature_compatible(self.obj.attrfunc, self.obj.instancemeth))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例8: test_attrfunc_signature_is_not_compatible_with_class_unbound_method

 def test_attrfunc_signature_is_not_compatible_with_class_unbound_method(self):
     self.assertFalse(is_signature_compatible(self.obj.attrfunc, DifferentMethods.instancemeth))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例9: test_static_signature_is_compatible_with_attrfunc

 def test_static_signature_is_compatible_with_attrfunc(self):
     self.assertTrue(is_signature_compatible(self.obj.staticmeth, self.obj.attrfunc))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例10: test_static_signature_is_compatible_with_obj_instance_method

 def test_static_signature_is_compatible_with_obj_instance_method(self):
     self.assertTrue(is_signature_compatible(self.obj.staticmeth, self.obj.instancemeth))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例11: test_static_signature_is_compatible_with_obj_class_sig

 def test_static_signature_is_compatible_with_obj_class_sig(self):
     self.assertTrue(is_signature_compatible(self.obj.staticmeth, self.obj.classmeth))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例12: test_all_varargs_is_not_compatibile_with_three_args_varargs

 def test_all_varargs_is_not_compatibile_with_three_args_varargs(self):
     self.assertEquals(False, is_signature_compatible(all_varargs_callable, three_args_varargs_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例13: test_three_args_varargs_is_compatible_with_three_args_varargs

 def test_three_args_varargs_is_compatible_with_three_args_varargs(self):
     self.assertEquals(True, is_signature_compatible(three_args_varargs_callable, three_args_varargs_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例14: test_all_varargs_is_compatibile_with_all_varargs

 def test_all_varargs_is_compatibile_with_all_varargs(self):
     self.assertEquals(True, is_signature_compatible(all_varargs_callable, all_varargs_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py

示例15: test_all_varargs_is_not_compatibile_with_empty

 def test_all_varargs_is_not_compatibile_with_empty(self):
     self.assertEquals(False, is_signature_compatible(all_varargs_callable, empty_callable))
开发者ID:alanfranz,项目名称:pydenji,代码行数:2,代码来源:test_signature.py


注:本文中的pydenji.ducktypes.signature.is_signature_compatible函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。