MCPcopy Create free account
hub / github.com/ActiveState/code / insert

Method insert

recipes/Python/284569_caselessList/recipe-284569.py:112–116  ·  view source on GitHub ↗

s.insert(i, x) same as s[i:i] = [x] Raises TypeError if x isn't a string.

(self, i, x)

Source from the content-addressed store, hash-verified

110 raise ValueError(': list.index(x): x not in list')
111
112 def insert(self, i, x):
113 """s.insert(i, x) same as s[i:i] = [x]
114 Raises TypeError if x isn't a string."""
115 if not isinstance(x, str): raise TypeError('Members of this object must be strings. You supplied \"%s\"' % type(x))
116 list.insert(self, i, x)
117
118 def __setitem__(self, index, value):
119 """For setting values in the list.

Callers 3

move_leftMethod · 0.45
recipe-284569.pyFile · 0.45
recipe-215301.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected