<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, 29 Nov 2018 at 14:12, Andrew Svetlov <<a href="mailto:andrew.svetlov@gmail.com">andrew.svetlov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Neither http.client nor http.server doesn't support compression (gzip/compress/deflate) at all.<br>I doubt if we want to add this feature: for client better to use requests or, well, aiohttp.<br>The same for servers: almost any production ready web server from PyPI supports compression.<br></div></blockquote><div><br></div><div>There was actually a PR to add compressions support to http.server but I closed it in the name of maintainability since http.server, as you said, isn't for production use so compression isn't critical.</div><div><br></div><div>-Brett<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>I don't insist on adding brotli to standard library.<br>There is officiall brotli library on PyPI from google, binary wheels are provided.<br>Unfortunately installing from a tarball requires C++ compiler<br>On other hand writing a binding in pure C looks very easy.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 10:30 PM Gregory P. Smith <<a href="mailto:greg@krypto.org" target="_blank">greg@krypto.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 2:58 AM Andrew Svetlov <<a href="mailto:andrew.svetlov@gmail.com" target="_blank">andrew.svetlov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">5 cents about lz4 alternatives: Broli (mentioned above) is widely supported by web.<br><br><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding" target="_blank">https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding</a> mentions it along with gzip and deflate methods.<br>I don't recall lz4 or Zstd metioning in this context.<br><br>Both Chrome/Chromium and Firefox accepts it by default (didn't check Microsoft products yet).<br></div></div></blockquote><div><br></div><div>Acceptance by multiple popular browsers is a good reason to <i>also</i> propose brotli support in the stdlib. Though it'd probably make sense to actually _support_ Accept-Encoding based on available compression modules within the stdlib http.client (and potentially server) as a prerequisite for that reasoning. <a href="https://github.com/python/cpython/blob/master/Lib/http/client.py#L1168" target="_blank">https://github.com/python/cpython/blob/master/Lib/http/client.py#L1168</a>.</div><div><br></div><div>-gps</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">P.S.<br>I worked with lz4 python binding a year ago. <br>It sometimes crashed to core dump when used in multithreaded environment (we used to run compressor/decompresson with asyncio by loop.run_in_executor() call).<br>I hope the bug is fixed now, have no update for the current state.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 12:04 PM INADA Naoki <<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Nov 29, 2018 at 6:27 AM Steven D'Aprano <<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>> wrote:<br>
><br>
> On Wed, Nov 28, 2018 at 10:43:04AM -0800, Gregory P. Smith wrote:<br>
><br>
> > PyPI makes getting more algorithms easy.<br>
><br>
> Can we please stop over-generalising like this? PyPI makes getting<br>
> more algorithms easy for *SOME* people. (Sorry for shouting, but you<br>
> just pressed one of my buttons.)<br>
<br>
I don't think this is over-generalising.<br>
<br>
If "get it from PyPI" is not easy enough, why not adding hundreds of<br>
famous libraries?<br>
Because we can't maintain all of them well.<br>
<br>
When considering adding new format (not only compression, but also<br>
serialization like toml), I think it should be stable, widely used, and will<br>
be used widely for a long time.  If we want to use the format in Python core<br>
or Python stdlib, it's good reasoning too.  gzip and json are good example.<br>
<br>
When we say "we can use PyPI", it means "are there enough reasons<br>
make the package special enough to add to stdlib?"  We don't mean<br>
"everyone can use PyPI."<br>
<br>
Regards,<br>
-- <br>
INADA Naoki  <<a href="mailto:songofacandy@gmail.com" target="_blank">songofacandy@gmail.com</a>><br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/andrew.svetlov%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/andrew.svetlov%40gmail.com</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-2925007091374452637m_-4301545828641545544gmail-m_8441721791521781210gmail_signature">Thanks,<br>Andrew Svetlov</div>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/greg%40krypto.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/greg%40krypto.org</a><br>
</blockquote></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-2925007091374452637gmail_signature" data-smartmail="gmail_signature">Thanks,<br>Andrew Svetlov</div>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/brett%40python.org" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/brett%40python.org</a><br>
</blockquote></div></div>