|
39 | 39 | BackendFilter.NON_INTERACTIVE)
|
40 | 40 | _deprecated_all_backends = backend_registry.list_builtin()
|
41 | 41 |
|
42 |
| -_deprecated_names_and_args = { |
43 |
| - "interactive_bk": "matplotlib.backends.registry.BackendFilter.INTERACTIVE", |
44 |
| - "non_interactive_bk": "matplotlib.backends.registry.BackendFilter.NON_INTERACTIVE", |
45 |
| - "all_backends": "", |
46 |
| -} |
47 |
| - |
48 |
| - |
49 |
| -def __getattr__(name): |
50 |
| - if name in _deprecated_names_and_args: |
51 |
| - arg = _deprecated_names_and_args[name] |
52 |
| - _api.warn_deprecated( |
53 |
| - "3.9.0", |
54 |
| - name=name, |
55 |
| - alternative="``matplotlib.backends.registry.backend_registry" |
56 |
| - f".list_builtin({arg})``", |
57 |
| - ) |
58 |
| - return globals()[f"_deprecated_{name}"] |
59 |
| - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
60 |
| - |
61 | 42 |
|
62 |
| -def __dir__(): |
63 |
| - return sorted(globals().keys() | _deprecated_names_and_args.keys()) |
| 43 | +@_api.caching_module_getattr |
| 44 | +class __getattr__: |
| 45 | + interactive_bk = _api.deprecated( |
| 46 | + "3.9", |
| 47 | + alternative="``matplotlib.backends.registry.backend_registry.list_builtin" |
| 48 | + "(matplotlib.backends.registry.BackendFilter.INTERACTIVE)``" |
| 49 | + )(property(lambda self: _deprecated_interactive_bk)) |
| 50 | + |
| 51 | + non_interactive_bk = _api.deprecated( |
| 52 | + "3.9", |
| 53 | + alternative="``matplotlib.backends.registry.backend_registry.list_builtin" |
| 54 | + "(matplotlib.backends.registry.BackendFilter.NON_INTERACTIVE)``" |
| 55 | + )(property(lambda self: _deprecated_non_interactive_bk)) |
| 56 | + |
| 57 | + all_backends = _api.deprecated( |
| 58 | + "3.9", |
| 59 | + alternative="``matplotlib.backends.registry.backend_registry.list_builtin()``" |
| 60 | + )(property(lambda self: _deprecated_all_backends)) |
64 | 61 |
|
65 | 62 |
|
66 | 63 | class ValidateInStrings:
|
|
0 commit comments