<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
So my question is whether it's bad practice to set things up so each<br>
method operates on self.document or should I pass document around from<br>
one function to the next?<br></blockquote><div><br>I think this depends on the use case. <br><br>If the functions you're calling in between have a chance to be called independently, then I would probably allow passing the documents in the arguments, so that other code can utilise this function. On the other extreme, if this function is only used internally, I would simply use self.object to avoid copying extra references, and treat them as sub routines. I would also previx two underscores (__) before the function to indicate that it's supposed to be interal-use only.<br>
<br>The other use case is, if self.object is useful after the function, I would keep it as that. Then, other code could use it without processing it again. On the other hand, if it is useless after created and returned, then I would not keep a reference in the class object.<br>
<br>All in all, you probably won't find a big performance difference, so it all boils down to logical placement.<br><br>Cheers,<br>Xav<br></div></div>