kutsurak / python-bitstring

Automatically exported from code.google.com/p/python-bitstring
0 stars 0 forks source link

Allow negative indices for other functions #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For consistency we should allow standard negative index notation for some
other functions:

s.insert(bs, -1) # insert bs at one bit from the end

This could include functions like find() that have a start and end:

s.find(bs, start=-100)  # find in the last 100 bits

Affected functions:

find
findall
rfind
cut
split
startswith
endswith
replace
insert
overwrite
reverse
reversebytes
ror /rol (once they get a start / end)

Original issue reported on code.google.com by python.bitstring@googlemail.com on 7 Jan 2010 at 8:20

GoogleCodeExporter commented 9 years ago
Done in revision 634.

Original comment by python.bitstring@googlemail.com on 26 Jan 2010 at 5:06