Return the subset of this RcParams dictionary whose keys match, using :func:`re.search`, the given ``pattern``. .. note:: Changes to the returned dictionary are *not* propagated to the parent RcParams dictionary.
(self, pattern)
| 821 | return dict.__len__(self) |
| 822 | |
| 823 | def find_all(self, pattern): |
| 824 | """ |
| 825 | Return the subset of this RcParams dictionary whose keys match, |
| 826 | using :func:`re.search`, the given ``pattern``. |
| 827 | |
| 828 | .. note:: |
| 829 | |
| 830 | Changes to the returned dictionary are *not* propagated to |
| 831 | the parent RcParams dictionary. |
| 832 | |
| 833 | """ |
| 834 | pattern_re = re.compile(pattern) |
| 835 | return self.__class__( |
| 836 | (key, value) for key, value in self.items() if pattern_re.search(key) |
| 837 | ) |
| 838 | |
| 839 | def copy(self): |
| 840 | """Copy this RcParams instance.""" |