h.Section vs h.Section()

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

Moderator: hines

Post Reply
vellamike

h.Section vs h.Section()

Post by vellamike »

Hi,

I'm trying to understand the difference between these two, is h.Section() a method which returns a section object? In which case what is the h.Section class for?

Thanks in advance,
Mike
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: h.Section vs h.Section()

Post by hines »

to construct a hoc class instance from within python the syntax is
instance = h.ClassName(args)
So you can think of it as a method whch returns an instance of the class.
h.ClassName
returns a callable which could then be used to construct an instance. eg.
Section = h.Section
sec = Section()
vellamike

Re: h.Section vs h.Section()

Post by vellamike »

That makes sense now, thanks!
Post Reply