2020-09-22

Don't speak so loudly sir, or everyone will want one!

Is that a bug in my BeautifulSoup?

It seems that the maintainers consider prettify() to be a debugging tool and are not concerned that it often adds unmeant white-space to the output.

Uhm. Really?

I mean, I can see the utility of a tool which exposes the tag structure as clearly as possible, but I also like to have my machine generated code look good (i.e. be fairly readable) while it remains correct. Perhaps a interface like prettify(preserve_output=False) would be in order?1


1 Here I have selected the default sense to not break existing code, starting ab inito I would have made True the default.)

No comments:

Post a Comment