[Python-Dev] Rework nntplib?
ncoghlan at gmail.com
Mon Sep 20 13:26:28 CEST 2010
On Mon, Sep 20, 2010 at 12:25 PM, R. David Murray <rdmurray at bitdance.com> wrote:
> On Mon, 20 Sep 2010 06:55:50 +1000, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> On Mon, Sep 20, 2010 at 3:27 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> > For the record, the code is pretty much done now:
>> > http://bugs.python.org/issue9360
>> Generally looks pretty reasonable. As I noted on the issue, my one
>> concern is that the current API seems to rely on the programmer
>> remembering which methods return strings and which return bytes
>> without any consistent mnemonic as to which is which.
> The mnemonic is: *raw message data* is bytes, everything else is unicode.
> That is, the *content* of head, body, article, post, and ihave commands
> is bytes, otherwise you are dealing with strings. I think it is a
> very clear and obvious distinction, myself.
Yeah, after Antoine's response, I was happy that was a problem with my
understanding of the API, rather than the API itself.
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev