You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make it possible to use rc_context as a decorator.
See changelog note.
There are also other advantages with contextmanager, e.g. reusing a
context multiple times works
```
ctx = rc_context(...)
with ctx: ... # in the context
... # out of the context
with ctx: ... # in the context again
```
(with a test for the decorator form, which is equivalent) but in
practice this will often run into the issue of early/late resolution of
rcParams, so I didn't mention it in the changelog.
xkcd() still needs to be implemented manually in terms of
`__enter__`/`__exit__` but at least we know that creation of the
contextmanager cannot fail, so things are simpler.
Also we don't need to check for whether the backend has been
resolved because rcParams now just prevent re-setting the backend to
auto_backend_sentinel.
0 commit comments