FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-14465: Provide simple prett printing for XML and ETree API by mcepl · Pull Request #8933 · python/cpython · GitHub

Repository navigation

bpo-14465: Provide simple prett printing for XML and ETree API - #8933

Closed
mcepl wants to merge 1 commit into
python:masterfrom
mcepl:14465_xml-pretty_print
Closed

mcepl wants to merge 1 commit into
python:masterfrom
mcepl:14465_xml-pretty_print

Conversation

mcepl commented Aug 25, 2018 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Comparing to the solution suggested in #4016, this should bear no performance penalty when pretty_print=False (which is the default). On the other hand, it is not suitable for processing of large XML data. Then some alternative solution (e.g., lxml module) must be used.

https://bugs.python.org/issue14465

Comparing to the solution suggested in #4016, this should bear no
performance penalty when pretty_print=False (which is the default). On
the other hand, it is not suitable for processing of large XML data.
Then some alternative solution (e.g., lxml module) must be used.

mcepl commented Aug 25, 2018

Copy link
Copy Markdown
Contributor Author

@scoder, what do you think?

enc_lower = encoding.lower()

if pretty_print:
self._indent(self._root)

scoder Aug 25, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sorry, but write() is an output method. It shouldn't have side-effects that change the tree.
Just imagine you'd print or log the tree for debugging purposes and it would alter the serialised result later on.

scoder commented Apr 14, 2019

Copy link
Copy Markdown
Contributor

Rejecting this PR in its current form, because it adds a side-effect to an otherwise pure output function.

scoder closed this Apr 14, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL