|
30 | 30 | from matplotlib import _api, _c_internal_utils |
31 | 31 |
|
32 | 32 |
|
33 | | -@_api.caching_module_getattr |
34 | | -class __getattr__: |
35 | | - # module-level deprecations |
36 | | - MatplotlibDeprecationWarning = _api.deprecated( |
37 | | - "3.6", obj_type="", |
38 | | - alternative="matplotlib.MatplotlibDeprecationWarning")( |
39 | | - property(lambda self: _api.deprecation.MatplotlibDeprecationWarning)) |
40 | | - mplDeprecation = _api.deprecated( |
41 | | - "3.6", obj_type="", |
42 | | - alternative="matplotlib.MatplotlibDeprecationWarning")( |
43 | | - property(lambda self: _api.deprecation.MatplotlibDeprecationWarning)) |
44 | | - |
45 | | - |
46 | 33 | def _get_running_interactive_framework(): |
47 | 34 | """ |
48 | 35 | Return the interactive framework whose event loop is currently running, if |
@@ -578,27 +565,6 @@ def flatten(seq, scalarp=is_scalar_or_string): |
578 | 565 | yield from flatten(item, scalarp) |
579 | 566 |
|
580 | 567 |
|
581 | | -@_api.deprecated("3.6", alternative="functools.lru_cache") |
582 | | -class maxdict(dict): |
583 | | - """ |
584 | | - A dictionary with a maximum size. |
585 | | -
|
586 | | - Notes |
587 | | - ----- |
588 | | - This doesn't override all the relevant methods to constrain the size, |
589 | | - just ``__setitem__``, so use with caution. |
590 | | - """ |
591 | | - |
592 | | - def __init__(self, maxsize): |
593 | | - super().__init__() |
594 | | - self.maxsize = maxsize |
595 | | - |
596 | | - def __setitem__(self, k, v): |
597 | | - super().__setitem__(k, v) |
598 | | - while len(self) >= self.maxsize: |
599 | | - del self[next(iter(self))] |
600 | | - |
601 | | - |
602 | 568 | class Stack: |
603 | 569 | """ |
604 | 570 | Stack of elements with a movable cursor. |
@@ -891,25 +857,17 @@ def __init__(self, grouper): |
891 | 857 | self._grouper = grouper |
892 | 858 |
|
893 | 859 | class _GrouperMethodForwarder: |
894 | | - def __init__(self, deprecated_kw=None): |
895 | | - self._deprecated_kw = deprecated_kw |
896 | | - |
897 | 860 | def __set_name__(self, owner, name): |
898 | 861 | wrapped = getattr(Grouper, name) |
899 | 862 | forwarder = functools.wraps(wrapped)( |
900 | 863 | lambda self, *args, **kwargs: wrapped( |
901 | 864 | self._grouper, *args, **kwargs)) |
902 | | - if self._deprecated_kw: |
903 | | - forwarder = _api.deprecated(**self._deprecated_kw)(forwarder) |
904 | 865 | setattr(owner, name, forwarder) |
905 | 866 |
|
906 | 867 | __contains__ = _GrouperMethodForwarder() |
907 | 868 | __iter__ = _GrouperMethodForwarder() |
908 | 869 | joined = _GrouperMethodForwarder() |
909 | 870 | get_siblings = _GrouperMethodForwarder() |
910 | | - clean = _GrouperMethodForwarder(deprecated_kw=dict(since="3.6")) |
911 | | - join = _GrouperMethodForwarder(deprecated_kw=dict(since="3.6")) |
912 | | - remove = _GrouperMethodForwarder(deprecated_kw=dict(since="3.6")) |
913 | 871 |
|
914 | 872 |
|
915 | 873 | def simple_linear_interpolation(a, steps): |
|
0 commit comments