Commit d956c30
committed
gh-144270: make SubElement parent and tag positional-only
The C accelerator in _elementtree.c uses PyArg_ParseTuple, which
makes parent and tag positional-only. The Python fallback in
ElementTree.py allowed them as keyword arguments, creating an
inconsistency. Most users never noticed because the C version
overrides the Python version via "from _elementtree import *".
Add "/" after tag in the Python signature to match the C behavior.
The attrib parameter remains keyword-capable since the C version
accepts it via get_attrib_from_keywords().1 parent 645f5c4 commit d956c30
File tree
3 files changed
+25
-2
lines changed- Doc/library
- Lib
- test
- xml/etree
3 files changed
+25
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
| 696 | + | |
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
707 | 710 | | |
708 | 711 | | |
709 | 712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
487 | 507 | | |
488 | 508 | | |
489 | 509 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
0 commit comments