Bill Janssen <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]
> wrote:
>
> Amaury Forgeot d'Arc <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue3805>
> _______________________________________
>
Added file: http://bugs.python.org/file11446/unnamed
_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3805>
_______________________________________
<div dir="ltr">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.<br><br><div
class="gmail_quote">
On Tue, Sep 9, 2008 at 4:14 AM, Amaury Forgeot d'Arc <span dir="ltr"><<a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>></span>
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid
rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Amaury Forgeot d'Arc <<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>> added the comment:<br>
<br>
The same function has two distinct behaviours:<br>
- If you pass a number, it return a bytes object.<br>
- If you pass a buffer, it returns a number!<br>
Different arguments and different return types: they should have<br>
different names IMO.<br>
<br>
io.py proposes read(n) and readinto(buf) for this distinction, and I<br>
fail to see a reason why PySSL_SSLread need to be different:<br>
<br>
- readinto(buf, count=-1) could be similar to the actual PySSL_SSLread.<br>
the "count" defaults to len(buf).<br>
- read(count) could be implemented in C or python (or not at all), it is<br>
equivalent to:<br>
def read(self, count=1024):<br>
buf = bytearray(count)<br>
nb = self.readinto(buf)<br>
return bytes(buf[:nb])<br>
<br>
----------<br>
nosy: +amaury.forgeotdarc<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________<br>
Python tracker <<a href="mailto:[EMAIL PROTECTED]">[EMAIL
PROTECTED]</a>><br>
<<a href="http://bugs.python.org/issue3805"
target="_blank">http://bugs.python.org/issue3805</a>><br>
_______________________________________<br>
</div></div></blockquote></div><br></div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com