Commit 5c34b2b
committed
Factor out legend/figlegend nargs validation.
Currently Figure.legend supposedly supports extra_args, forwarding them
to the Legend constructor, but because all parameters of the Legend
constructor except for the first two have become keyword-only,
extra_args actually causes a TypeError to be raised when calling
Legend(...) (try e.g. `plt.figlegend([], [], "right")`). So just don't
bother with extra_args anymore, check the case of "more than two
positional args" in _parse_legend_args, and also fix
test_legend_label_three_args, which was actually hiding the above
exception via a mock and not really testing a relevant case anymore.1 parent 060992a commit 5c34b2b
File tree
4 files changed
+13
-46
lines changed- lib/matplotlib
- axes
- tests
4 files changed
+13
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
| 319 | + | |
325 | 320 | | |
326 | 321 | | |
327 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1128 | 1128 | | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
| 1131 | + | |
1147 | 1132 | | |
1148 | | - | |
1149 | | - | |
| 1133 | + | |
| 1134 | + | |
1150 | 1135 | | |
1151 | 1136 | | |
1152 | 1137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1344 | 1344 | | |
1345 | 1345 | | |
1346 | 1346 | | |
1347 | | - | |
1348 | | - | |
1349 | 1347 | | |
1350 | 1348 | | |
1351 | 1349 | | |
1352 | 1350 | | |
1353 | 1351 | | |
1354 | 1352 | | |
1355 | 1353 | | |
1356 | | - | |
1357 | 1354 | | |
1358 | 1355 | | |
1359 | 1356 | | |
| |||
1371 | 1368 | | |
1372 | 1369 | | |
1373 | 1370 | | |
1374 | | - | |
1375 | | - | |
| 1371 | + | |
1376 | 1372 | | |
1377 | 1373 | | |
1378 | 1374 | | |
1379 | 1375 | | |
1380 | 1376 | | |
1381 | 1377 | | |
1382 | 1378 | | |
1383 | | - | |
1384 | | - | |
| 1379 | + | |
1385 | 1380 | | |
1386 | 1381 | | |
1387 | 1382 | | |
| |||
1391 | 1386 | | |
1392 | 1387 | | |
1393 | 1388 | | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
| 1389 | + | |
1397 | 1390 | | |
1398 | | - | |
1399 | 1391 | | |
1400 | | - | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
| 456 | + | |
457 | 457 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
| 458 | + | |
467 | 459 | | |
468 | 460 | | |
469 | 461 | | |
| |||
0 commit comments