You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use negatives keys for sections
like :
last_section=page.my_sections[-1]
but due to this code it is impossible
def__getitem__(self, idx):
ifidx<0oridx>=len(self):
raiseIndexError("Sections index (%d) out of range"%idx)
fori, _inenumerate(self):
ifi==idx:
breakreturnself
The text was updated successfully, but these errors were encountered:
drobota
changed the title
Sections don't support negatives keys
Sections don't support negative keys
Oct 23, 2014
The way Holmium conflates sections and section elements is really surprising. I already fixed a bug in this method earlier this year where any index greater than 1 would fail. I think the correct fix for this is to overhaul the structure of the object model so that child items within sections are separate objects.
I would like to use negatives keys for sections
like :
but due to this code it is impossible
The text was updated successfully, but these errors were encountered: