|
33 | 33 | from cycler import Cycler, cycler as ccycler
|
34 | 34 |
|
35 | 35 |
|
36 |
| -# Deprecation of module-level attributes using PEP 562 |
37 |
| -_deprecated_interactive_bk = backend_registry.list_builtin(BackendFilter.INTERACTIVE) |
38 |
| -_deprecated_non_interactive_bk = backend_registry.list_builtin( |
39 |
| - BackendFilter.NON_INTERACTIVE) |
40 |
| -_deprecated_all_backends = backend_registry.list_builtin() |
41 |
| - |
42 |
| - |
43 | 36 | @_api.caching_module_getattr
|
44 | 37 | class __getattr__:
|
45 |
| - interactive_bk = _api.deprecated( |
| 38 | + @_api.deprecated( |
46 | 39 | "3.9",
|
47 | 40 | alternative="``matplotlib.backends.registry.backend_registry.list_builtin"
|
48 |
| - "(matplotlib.backends.registry.BackendFilter.INTERACTIVE)``" |
49 |
| - )(property(lambda self: _deprecated_interactive_bk)) |
| 41 | + "(matplotlib.backends.registry.BackendFilter.INTERACTIVE)``") |
| 42 | + @property |
| 43 | + def interactive_bk(self): |
| 44 | + return backend_registry.list_builtin(BackendFilter.INTERACTIVE) |
50 | 45 |
|
51 |
| - non_interactive_bk = _api.deprecated( |
| 46 | + @_api.deprecated( |
52 | 47 | "3.9",
|
53 | 48 | alternative="``matplotlib.backends.registry.backend_registry.list_builtin"
|
54 |
| - "(matplotlib.backends.registry.BackendFilter.NON_INTERACTIVE)``" |
55 |
| - )(property(lambda self: _deprecated_non_interactive_bk)) |
| 49 | + "(matplotlib.backends.registry.BackendFilter.NON_INTERACTIVE)``") |
| 50 | + @property |
| 51 | + def non_interactive_bk(self): |
| 52 | + return backend_registry.list_builtin(BackendFilter.NON_INTERACTIVE) |
56 | 53 |
|
57 |
| - all_backends = _api.deprecated( |
| 54 | + @_api.deprecated( |
58 | 55 | "3.9",
|
59 |
| - alternative="``matplotlib.backends.registry.backend_registry.list_builtin()``" |
60 |
| - )(property(lambda self: _deprecated_all_backends)) |
| 56 | + alternative="``matplotlib.backends.registry.backend_registry.list_builtin()``") |
| 57 | + @property |
| 58 | + def all_backends(self): |
| 59 | + return backend_registry.list_builtin() |
61 | 60 |
|
62 | 61 |
|
63 | 62 | class ValidateInStrings:
|
|
0 commit comments