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&#39;s not deep-end on this.&nbsp; It&#39;s an 
admittedly eccentric but working and purely internal interface.&nbsp; 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&#39;Arc <span dir="ltr">&lt;<a 
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>&gt;</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&#39;Arc &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt; 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 &quot;count&quot; defaults to len(buf).<br>
- read(count) could be implemented in C or python (or not at all), it is<br>
equivalent to:<br>
 &nbsp; &nbsp;def read(self, count=1024):<br>
 &nbsp; &nbsp; &nbsp; &nbsp;buf = bytearray(count)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;nb = self.readinto(buf)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;return bytes(buf[:nb])<br>
<br>
----------<br>
nosy: +amaury.forgeotdarc<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________<br>
Python tracker &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
PROTECTED]</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue3805"; 
target="_blank">http://bugs.python.org/issue3805</a>&gt;<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

Reply via email to