MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / check_compatible

Function check_compatible

tools/check_api_compatible.py:71–88  ·  view source on GitHub ↗

check compatible, FullArgSpec

(old_api_spec, new_api_spec)

Source from the content-addressed store, hash-verified

69
70
71def check_compatible(old_api_spec, new_api_spec):
72 """
73 check compatible, FullArgSpec
74 """
75 if not (
76 isinstance(old_api_spec, inspect.FullArgSpec)
77 and isinstance(new_api_spec, inspect.FullArgSpec)
78 ):
79 logger.warning(
80 "new_api_spec or old_api_spec is not instance of inspect.FullArgSpec"
81 )
82 return False
83 return _check_compatible(
84 old_api_spec.args,
85 new_api_spec.args,
86 [] if old_api_spec.defaults is None else old_api_spec.defaults,
87 [] if new_api_spec.defaults is None else new_api_spec.defaults,
88 )
89
90
91def check_compatible_str(old_api_spec_str, new_api_spec_str):

Callers 5

test_args_addedMethod · 0.90
test_args_reducedMethod · 0.90

Calls 1

_check_compatibleFunction · 0.85

Tested by 4

test_args_addedMethod · 0.72
test_args_reducedMethod · 0.72