Tim Arnold a écrit :
On Apr 8, 4:20 am, Bruno Desthuilliers <bruno.
(snip)
There are two points here : the first is that we (that is, at least, you
and me) just don't know enough about the OP's project to tell whether
something should belong to the document or not. period. The second point
is that objects don't live in a splendid isolation, and it's perfectly
ok to have code outside an object's method working on the object.

wrt/ these two points, your "document should encapsulate its own logic"
note seems a bit dogmatic (and not necessarily right) to me - hence my
answer.

The 'document' in this case is an lxml Elementtree, so I think it
makes sense to have code outside the object.

Indeed. It's the only sensible thing to do here.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to