On 8 March 2011 06:19, Ben Dickson <[email protected]> wrote:

> node['blah'].value()
>
> ..is less typing, so I use that over the functionally identical
> node.knob("blah").value()
>

They're not identical -- ["blah"] will raise a KeyError for a missing knob,
whereas knob("blah") will return None. Subtle!


>
> I use node.knobs() occasionally to iterate over all knobs (or use
> node.knobs().keys() )
>

> Incidentally I use [''] over [""], because the first can be typed
> without shift (on UK/Australian keyboards anyway) - same with ("") which
> can be typed with shift held. Efficiency!...
>

> John RA Benson wrote:
> > Hey there -
> >
> > Basic question:
> >
> > just curious - if find myself flipping between using syntax like:
> >
> > node.knob('myknob').value()
> > vs:
> > node['myknob'].value()
> >
> > Is there any 'best practices' or preferred way to write that? Sort of
> like, do you always use '"' or "'" for quotes...
> >
> > Cheers
> > JRAB_______________________________________________
> > Nuke-python mailing list
> > [email protected]
> > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
> >
>
> --
> ben dickson
> 2D TD | [email protected]
> rising sun pictures | www.rsp.com.au
>
> _______________________________________________
> Nuke-python mailing list
> [email protected]
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>



-- 
Alexander Jones
Double Negative R&D
www.dneg.com
_______________________________________________
Nuke-python mailing list
[email protected]
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to