no subscripting of SectionList in python

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
wwlytton
Posts: 64
Joined: Wed May 18, 2005 10:37 pm

no subscripting of SectionList in python

Post by wwlytton » 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

Post Reply