Page 1 of 1

h.Section vs h.Section()

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

Re: h.Section vs h.Section()

Posted: Wed Nov 03, 2010 12:23 pm
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()

Re: h.Section vs h.Section()

Posted: Wed Nov 03, 2010 12:45 pm
by vellamike
That makes sense now, thanks!