Re: [Python-Dev] Rework nntplib?
On Mon, Sep 20, 2010 at 12:25 PM, R. David Murray rdmur...@bitdance.com wrote: On Mon, 20 Sep 2010 06:55:50 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Mon, Sep 20, 2010 at 3:27 AM, Antoine Pitrou solip...@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. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Rework nntplib?
For the record, the code is pretty much done now: http://bugs.python.org/issue9360 Regards Antoine. On Tue, 14 Sep 2010 12:17:44 +0200 Antoine Pitrou solip...@pitrou.net wrote: Hello, Like the email package, nntplib in py3k is broken (because of various bytes/str mismatches; I suppose the lack of a test suite didn't help when porting). I would like to take the opportunity to improve the API a bit; no heavy re-architecting, but simply a bunch of changes to make it higher-level. Is it acceptable? (and, yes, I would add a test suite) Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Rework nntplib?
On Mon, Sep 20, 2010 at 3:27 AM, Antoine Pitrou solip...@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. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Rework nntplib?
On Mon, 20 Sep 2010 06:55:50 +1000, Nick Coghlan ncogh...@gmail.com wrote: On Mon, Sep 20, 2010 at 3:27 AM, Antoine Pitrou solip...@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. --David ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com