Commit 3e592d7
committed
Remove incorrect statement about data-kwarg interface.
We don't actually require `data` to support `key in data`; we only ever
try `data[key]` (treating any exception as meaning "`key` is not in
`data`, use its value directly"). This can be checked e.g. by creating
a custom type that supports `__getitem__` but throws on `in` checks, and
verify that it can be used as `data`:
```
class T: __getitem__ = lambda self, k: {"foo": 1, "bar": 2}[k]
l, = plt.plot("foo", "bar", data=T())
l.get_xydata() # == [[1, 2]]
"foo" in T() # raises
```
So delete the statement about `s in data`; the statement about `data[s]`
can also be removed as it is clearly implied by the fact that "`s` is
interpreted as `data[s]`".1 parent a3fbf18 commit 3e592d7
1 file changed
+4
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
| 1284 | + | |
1288 | 1285 | | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
| 1286 | + | |
| 1287 | + | |
1293 | 1288 | | |
1294 | | - | |
1295 | | - | |
| 1289 | + | |
1296 | 1290 | | |
1297 | 1291 | | |
1298 | 1292 | | |
| |||
0 commit comments