GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ElementTree slice assignment with start greater than stop duplicates a child without owning its second reference · Issue #161689 · python/cpython Open Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-XMLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportAssigning to a step-1 slice with import sys import xml.etree.ElementTree as ET kids = [ET.Element('a%d' % i) for i in range(7)] e = ET.Element('r') e[:] = kids before = sys.getrefcount(kids[2]) e[5:2] = [ET.Element('X')] tags = [c.tag for c in e] print(tags, 'refcount change of a2:', sys.getrefcount(kids[2]) - before) Recorded on 3.15.2 and main: Expected, also obtained with the pure-Python Element implementation: The duplicate Cause: Modules/_elementtree.c:1976-1977 uses CPython versions tested on:3.15, CPython main branch Operating systems tested on:Linux Found while building a Lean 4 model of CPython (https://broyojo.com/python-formalization/). AI tools (Claude and Codex) helped investigate the findings and prepare this report. The examples were rerun on CPython 3.15.2 and main, and the report received technical review. Record: textlibs-etree-slice-backward-dup Linked PRsActivity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-XMLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |