check compatible, FullArgSpec
(old_api_spec, new_api_spec)
| 69 | |
| 70 | |
| 71 | def 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 | |
| 91 | def check_compatible_str(old_api_spec_str, new_api_spec_str): |