[issue3805] sslobj.read py3k takes odd arguments
Bill Janssen
report at bugs.python.org
Tue Sep 9 18:51:38 CEST 2008
Bill Janssen <bill.janssen at gmail.com> added the comment:
Please, guys, let's not deep-end on this. It's an admittedly eccentric but
working and purely internal interface. There are actual release-blockers
that need to be addressed.
On Tue, Sep 9, 2008 at 4:14 AM, Amaury Forgeot d'Arc <report at bugs.python.org
> wrote:
>
> Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
>
> The same function has two distinct behaviours:
> - If you pass a number, it return a bytes object.
> - If you pass a buffer, it returns a number!
> Different arguments and different return types: they should have
> different names IMO.
>
> io.py proposes read(n) and readinto(buf) for this distinction, and I
> fail to see a reason why PySSL_SSLread need to be different:
>
> - readinto(buf, count=-1) could be similar to the actual PySSL_SSLread.
> the "count" defaults to len(buf).
> - read(count) could be implemented in C or python (or not at all), it is
> equivalent to:
> def read(self, count=1024):
> buf = bytearray(count)
> nb = self.readinto(buf)
> return bytes(buf[:nb])
>
> ----------
> nosy: +amaury.forgeotdarc
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue3805>
> _______________________________________
>
Added file: http://bugs.python.org/file11446/unnamed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3805>
_______________________________________
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unnamed
URL: <http://mail.python.org/pipermail/python-bugs-list/attachments/20080909/3e7f0973/attachment.txt>
More information about the Python-bugs-list
mailing list