8000 Do not warn-depreacted when iterating over rcParams by timhoffm · Pull Request #12658 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,9 @@ def __str__(self):
< 74B7 span class='blob-code-inner blob-code-marker ' data-code-marker=" ">
def __iter__(self):
"""Yield sorted list of keys."""
yield from sorted(dict.__iter__(self))
with warnings.catch_warnings():
warnings.simplefilter('ignore', MatplotlibDeprecationWarning)
yield from sorted(dict.__iter__(self))

def __len__(self):
return dict.__len__(self)
Expand All @@ -907,8 +909,7 @@ def find_all(self, pattern):
if pattern_re.search(key))

def copy(self):
return {k: dict.__getitem__(self, k)
for k in self}
return {k: dict.__getitem__(self, k) for k in self}


def rc_params(fail_on_error=False):
Expand Down
0