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 » Wed Nov 03, 2010 11:33 am

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: 1580
Joined: Wed May 18, 2005 3:32 pm

Re: h.Section vs h.Section()

Post by hines » Wed Nov 03, 2010 12:23 pm

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 » Wed Nov 03, 2010 12:45 pm

That makes sense now, thanks!

Post Reply