Skip to content

Latest commit

 

History

History
178 lines (123 loc) · 2.17 KB

dotproxylist.rst

File metadata and controls

178 lines (123 loc) · 2.17 KB

python

import sys sys.path.append("..")

import redbaron redbaron.ipython_behavior = False

from redbaron import RedBaron

DotProxyList usage examples

python

red = RedBaron("a.b(c).d[e]")

Please refer to python list documentation if you want to know the exact behavior or those methods (or send a patch to improve this documentation).

append

python

red red[0].value.append("(stuff)") red red[0].value

insert

python

red red[0].value.insert(1, "[foobar]") red red[0].value

extend

python

red red[0].value.extend(["a", "(hop)", "()"]) red red[0].value

pop

python

red red[0].value.pop() red red[0].value red[0].value.pop(3) red red[0].value


python

red red[0].value red[0].value[2]


python

red red[0].value[2] = "[1:2]" red red[0].value

remove

python

red red[0].value.remove(red[0].value[2]) red red[0].value

index

python

red red[0].value red[0].value.index(red[0].value[2])

count

python

red red[0].value red[0].value.count(red[0].value[2])

len

python

red red[0].value len(red[0].value)


python

red del red[0].value[2] red red[0].value

in

python

red red[0].value[2] in red[0].value


python

red for i in red[0].value: print(i.dumps())


python

red red[0].value red[0].value[2:4]


python

red red[0].value[2:4] = ["(foo)", "a", "b", "c"] red red[0].value


python

red red[0].value[2:5] del red[0].value[2:5] red red[0].value