|
41 | 41 | PIXELS_PER_INCH = 75
|
42 | 42 |
|
43 | 43 |
|
44 |
| -# module-level deprecations. |
45 |
| -@functools.lru_cache(None) |
46 |
| -def __getattr__(name): |
47 |
| - if name == "IDLE_DELAY": |
48 |
| - _api.warn_deprecated("3.1", name=name) |
49 |
| - return 5 |
50 |
| - elif name == "cursord": |
51 |
| - _api.warn_deprecated("3.5", name=name) |
52 |
| - return { # deprecated in Matplotlib 3.5. |
53 |
| - cursors.MOVE: wx.CURSOR_HAND, |
54 |
| - cursors.HAND: wx.CURSOR_HAND, |
55 |
| - cursors.POINTER: wx.CURSOR_ARROW, |
56 |
| - cursors.SELECT_REGION: wx.CURSOR_CROSS, |
57 |
| - cursors.WAIT: wx.CURSOR_WAIT, |
58 |
| - cursors.RESIZE_HORIZONTAL: wx.CURSOR_SIZEWE, |
59 |
| - cursors.RESIZE_VERTICAL: wx.CURSOR_SIZENS, |
60 |
| - } |
61 |
| - else: |
62 |
| - raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
| 44 | +@_api.caching_module_getattr # module-level deprecations |
| 45 | +class __getattr__: |
| 46 | + IDLE_DELAY = _api.deprecated("3.1", obj_type="", removal="3.6")(property( |
| 47 | + lambda self: 5)) |
| 48 | + cursord = _api.deprecated("3.5", obj_type="")(property(lambda self: { |
| 49 | + cursors.MOVE: wx.CURSOR_HAND, |
| 50 | + cursors.HAND: wx.CURSOR_HAND, |
| 51 | + cursors.POINTER: wx.CURSOR_ARROW, |
| 52 | + cursors.SELECT_REGION: wx.CURSOR_CROSS, |
| 53 | + cursors.WAIT: wx.CURSOR_WAIT, |
| 54 | + cursors.RESIZE_HORIZONTAL: wx.CURSOR_SIZEWE, |
| 55 | + cursors.RESIZE_VERTICAL: wx.CURSOR_SIZENS, |
| 56 | + })) |
63 | 57 |
|
64 | 58 |
|
65 | 59 | def error_msg_wx(msg, parent=None):
|
|
0 commit comments