Debian Codegraph @

rpython/tool/frozenlist.py

raw symbols SCIP
1 from rpython.tool.sourcetools import func_with_new_name
2
3 def forbid(*args):
4 raise TypeError("cannot mutate a frozenlist")
5
6 class frozenlist(list):
7 __setitem__ = func_with_new_name(forbid, '__setitem__')
8 __delitem__ = func_with_new_name(forbid, '__delitem__')
9 __setslice__ = func_with_new_name(forbid, '__setslice__')
10 __delslice__ = func_with_new_name(forbid, '__delslice__')
11 __iadd__ = func_with_new_name(forbid, '__iadd__')
12 __imul__ = func_with_new_name(forbid, '__imul__')
13 append = func_with_new_name(forbid, 'append')
14 insert = func_with_new_name(forbid, 'insert')
15 pop = func_with_new_name(forbid, 'pop')
16 remove = func_with_new_name(forbid, 'remove')
17 reverse = func_with_new_name(forbid, 'reverse')
18 sort = func_with_new_name(forbid, 'sort')
19 extend = func_with_new_name(forbid, 'extend')