This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ebfe
Recipients ebfe, pitrou, vstinner
Date 2008-12-27.02:02:44
SpamBayes Score 5.9783576e-07
Marked as misclassified No
Message-id <1230343365.93.0.619533861968.issue4738@psf.upfronthosting.co.za>
In-reply-to
Content
new svn diff attached

the indentation in this file is not my fault, it has tabs all over it...

The 5kb limits protects from the overhead of releasing the GIL. With
very small buffers the overall runtime in my benchmark tends to double.
I set it based on my testing and it remains being arbitrary to a certain
degree. Set the limit to 1 and try 1.000.000 times b'abc'...

May I also suggest to change the zlib module not to accept s* but y*:
 - Internally zlib operates on bytes, characters don't mean a thing in
zlib-land.
 - We rely on s* performing the encoding into default for us. This
behaviour is hidden from the programmer and somewhat violates the rule
of least surprise.
 - type(zlib.decompress(zlib.compress('abc'))) == bytes
 - Changing from s* to y* forces the programmer to use .encode() on his
strings (e.g. zlib.compress('abc'.encode()) which very clearly shows
what's happening.
History
Date User Action Args
2008-12-27 02:02:46ebfesetrecipients: + ebfe, pitrou, vstinner
2008-12-27 02:02:45ebfesetmessageid: <1230343365.93.0.619533861968.issue4738@psf.upfronthosting.co.za>
2008-12-27 02:02:45ebfelinkissue4738 messages
2008-12-27 02:02:44ebfecreate