Re: API design for Python 2 / 3 compatibility

2013-04-14 Thread Stefan Schwarzer
Terry, Ethan: Thanks a lot for your excellent advice. :-) On 2013-04-13 19:32, Terry Jan Reedy wrote: > Approach 2 matches (or should match) io.open, which became > builtin open in Python 3. I would simply document that > ftp_host.open mimics io.open in the same way that > ftp_host.chdir, etceter

Re: API design for Python 2 / 3 compatibility

2013-04-13 Thread Ethan Furman
On 04/13/2013 09:36 AM, Stefan Schwarzer wrote: * Approach 2 When opening remote text files for reading, ftputil will always return unicode strings from `read(line/s)`, regardless of whether it runs under Python 2 or Python 3. Pro: Uniform API, independent on underlying Python

Re: API design for Python 2 / 3 compatibility

2013-04-13 Thread Terry Jan Reedy
On 4/13/2013 12:36 PM, Stefan Schwarzer wrote: Hello, I'm currently changing the FTP client library ftputil [1] so that the same code of the library works with Python 2 (2.6 and up) and Python 3. (At the moment the code is for Python 2 only.) I've run into a API design issue where I don't know w

API design for Python 2 / 3 compatibility

2013-04-13 Thread Stefan Schwarzer
Hello, I'm currently changing the FTP client library ftputil [1] so that the same code of the library works with Python 2 (2.6 and up) and Python 3. (At the moment the code is for Python 2 only.) I've run into a API design issue where I don't know which API I should offer ftputil users under Pytho