<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 31, 2015 at 7:51 AM, E. Tadeu <span dir="ltr"><<a href="mailto:e.tadeu@gmail.com" target="_blank">e.tadeu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi!<div><br></div><div>  Why is there a static version for many methods in vtkPythonArgs (specially GetValue)?</div></div></blockquote><div><br></div><div>It allows those methods to be called without a vtkPythonArgs object ;)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>  I see that they are being used only by Py*_SequenceSize. Is there a special reason? Could the static versions be removed, and Py*_SequenceSize generated code use an instance of vtkPythonArgs, just like all other generated functions?</div></div></blockquote><div><br></div><div>They're also called by the other methods that make up the python sequence protocol, i.e. SequenceSetItem and Sequence(Get)Item.</div><div><br></div><div>As for why these protocol methods call the static version of GetValue(), it's because they have no need to create a vtkPythonArgs object.  The main purpose of the vtkPythonArgs object is to check the argument list, i.e. to verify that the correct number of arguments has been passed, to keep track of the current position in the argument list, etc. None of that is necessary for python protocol methods like SequenceSize.  All they need is a simple way to convert a python object to a C++ object or vice-versa.  The static methods serve that purpose.</div><div><br></div><div>If the python wrappers handled more python protocols, the static GetValue() methods would be more widely used.</div><div><br></div><div>Cheers,</div><div><br></div><div> - David</div><div> </div></div><br></div></div>