no subscripting of SectionList in python
Posted: Sun Dec 08, 2013 11:45 am
in some cases, the flexibility of python provides some additional functionality that was not available in hoc
in current case, I was hoping to avoid prior practice of copying SectionLists onto regular Lists to get random access -- I noted that in Python, a __getitem__ was exposed in dir(h.SectionList)
however that did not permit indexing, presumably due to the underlying structure being something that does not permit random access - a linked list?
h.SPI.apical.__getitem__(0)
... TypeError: unsubscriptable object
in current case, I was hoping to avoid prior practice of copying SectionLists onto regular Lists to get random access -- I noted that in Python, a __getitem__ was exposed in dir(h.SectionList)
however that did not permit indexing, presumably due to the underlying structure being something that does not permit random access - a linked list?
h.SPI.apical.__getitem__(0)
... TypeError: unsubscriptable object