Commit 7902910
committed
Deprecate the 'warn' parameter to matplotlib.use().
Right now, the only case where the 'warn' parameter to use() has an
observable effect is if the user calls
`use(some_backend, warn=True, force=False)` (the default is
`warn=False, force=True`) and `some_backend` cannot be switched to.
If they really want a warning in that case and not an exception (why?),
they can just do
```
try: use(some_backend)
except ImportError: warnings.warn(...)
```
instead.
Given the non-obvious interaction between `warn` and `force`, just
deprecate `warn`.
We could even deprecate `force` and tell user to catch ImportErrors if
they know a switch can fail and that they want to silently ignore the
switch failure, but I guess someone will complain that
`use(some_backend, force=False)` is so much shorter to write than
```
try: use(some_backend)
except ImportError: pass
```
...1 parent 7d92440 commit 7902910
3 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
| 1229 | + | |
1229 | 1230 | | |
1230 | 1231 | | |
1231 | 1232 | | |
| |||
1248 | 1249 | | |
1249 | 1250 | | |
1250 | 1251 | | |
1251 | | - | |
| 1252 | + | |
1252 | 1253 | | |
1253 | 1254 | | |
1254 | 1255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
0 commit comments