[docs] Provide some examples for usage of ElementTree methods/attributes (issue 15586)

ellisd23 at gmail.com ellisd23 at gmail.com
Thu Aug 9 15:36:03 CEST 2012


Thank you Eli and Ezio for your comments. I have made changes per your
suggestions and will upload the patch now.
http://bugs.python.org/review/15586/diff/5683/Doc/library/xml.etree.elementtree.rst
File Doc/library/xml.etree.elementtree.rst (right):
http://bugs.python.org/review/15586/diff/5683/Doc/library/xml.etree.elementtree.rst#newcode69
Doc/library/xml.etree.elementtree.rst:69: tree = ET()
I apologize. I originally wrote examples that ran and then saw that the
development version of the docs already had examples, so I attempted to
change over mine to match.
On 2012年08月09日 09:44:44, eli.bendersky wrote:
> Why are you calling the module here? Did you actually execute the
examples?
> Please make sure all examples execute correctly.
>> For loading data from the file, use ElementTree's constructor. No need
to invoke
> the parse method as well.

http://bugs.python.org/review/15586/diff/5683/Doc/library/xml.etree.elementtree.rst#newcode73
Doc/library/xml.etree.elementtree.rst:73: Reading the file from a remote
URL::
I guess the only point of confusion I saw is that when parsing from a
file (as a above), rather than taking a file object, parse takes the
filename in the current working directory. I'll go ahead and remove it
though, unless you think this point is valid.
On 2012年08月09日 09:44:44, eli.bendersky wrote:
> I don't think the urllib example belongs here. It's clear that if ET
can build
> itself from files, streams and strings, than everything that produces
those will
> work.

http://bugs.python.org/review/15586/diff/5683/Doc/library/xml.etree.elementtree.rst#newcode159
Doc/library/xml.etree.elementtree.rst:159: ... tree.write('output.xml')
I'm not sure from the code review tool which line you mean, though I
think it is 159. Let me know if I'm wrong.
On 2012年08月09日 10:51:48, ezio.melotti wrote:
> Leave an empty line before this (same with the following examples).

http://bugs.python.org/review/15586/


More information about the docs mailing list

AltStyle によって変換されたページ (->オリジナル) /