diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst index 00075ac2a23e6b..b842c5aff76e3d 100644 --- a/Doc/library/xml.etree.elementtree.rst +++ b/Doc/library/xml.etree.elementtree.rst @@ -610,8 +610,11 @@ Functions .. function:: iselement(element) - Check if an object appears to be a valid element object. *element* is an - element instance. Return ``True`` if this is an element object. + Check if *element* appears to be a valid element object or type. Return + ``True`` if this is an element object or type. + + Because ``iselement`` behaves identically for both objects and types, code + requiring an object should check for this, see :func:`isinstance`. .. function:: iterparse(source, events=None, parser=None) diff --git a/Misc/NEWS.d/next/Documentation/2025-07-09-15-06-27.gh-issue-136231.Wx8W-w.rst b/Misc/NEWS.d/next/Documentation/2025-07-09-15-06-27.gh-issue-136231.Wx8W-w.rst new file mode 100644 index 00000000000000..d5082eaf48158f --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2025-07-09-15-06-27.gh-issue-136231.Wx8W-w.rst @@ -0,0 +1,2 @@ +Document that :func:`xml.etree.ElementTree.iselement` works identically on +both object instances and types.