Check if module `f` is deprecated Parameters ---------- f : ModuleType Returns ------- bool
(f)
| 334 | |
| 335 | |
| 336 | def is_deprecated(f): |
| 337 | """ |
| 338 | Check if module `f` is deprecated |
| 339 | |
| 340 | Parameters |
| 341 | ---------- |
| 342 | f : ModuleType |
| 343 | |
| 344 | Returns |
| 345 | ------- |
| 346 | bool |
| 347 | """ |
| 348 | with warnings.catch_warnings(record=True) as w: |
| 349 | warnings.simplefilter("error") |
| 350 | try: |
| 351 | f(**{"not a kwarg":None}) |
| 352 | except DeprecationWarning: |
| 353 | return True |
| 354 | except Exception: |
| 355 | pass |
| 356 | return False |
| 357 | |
| 358 | |
| 359 | def check_items(all_dict, names, deprecated, others, module_name, dots=True): |