MCPcopy Index your code
hub / github.com/python/cpython / NodeList

Class NodeList

Lib/xml/dom/minicompat.py:50–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49
50class NodeList(list):
51 __slots__ = ()
52
53 def item(self, index):
54 if 0 <= index < len(self):
55 return self[index]
56
57 def _get_length(self):
58 return len(self)
59
60 def _set_length(self, value):
61 raise xml.dom.NoModificationAllowedErr(
62 "attempt to modify read-only attribute 'length'")
63
64 length = property(_get_length, _set_length,
65 doc="The number of nodes in the NodeList.")
66
67 # For backward compatibility
68 def __setstate__(self, state):
69 if state is None:
70 state = []
71 self[:] = state
72
73
74class EmptyNodeList(tuple):

Callers 15

test_nodelist_itemMethod · 0.85
test_nodelist_lengthMethod · 0.85
test_nodelist___add__Method · 0.85
test_nodelist_copyMethod · 0.85
unlinkMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 1

propertyClass · 0.85

Tested by 8

test_nodelist_itemMethod · 0.68
test_nodelist_lengthMethod · 0.68
test_nodelist___add__Method · 0.68
test_nodelist_copyMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…