Re: python 2 to 3 converter

2019-12-10 Thread Chris Angelico
On Wed, Dec 11, 2019 at 1:57 AM songbird wrote: > > Chris Angelico wrote: > > On Tue, Dec 10, 2019 at 12:15 PM songbird wrote: > >> > >> Chris Angelico wrote: > >> ... > >> > > >> > Here's an example piece of code. > >> > > >> > sock = socket.socket(...) > >> > name = input("Enter your username:

Re: python 2 to 3 converter

2019-12-10 Thread songbird
Chris Angelico wrote: > On Tue, Dec 10, 2019 at 4:41 PM songbird wrote: >> >> Chris Angelico wrote: >> ... >> > What if neither works, because there are assumptions that don't work? >> >> then you get stuck doing it by hand, but you would have >> been stuck doing it before for sure by hand so if

Re: python 2 to 3 converter

2019-12-10 Thread songbird
Chris Angelico wrote: > On Tue, Dec 10, 2019 at 12:15 PM songbird wrote: >> >> Chris Angelico wrote: >> ... >> > >> > Here's an example piece of code. >> > >> > sock = socket.socket(...) >> > name = input("Enter your username: ") >> > code = input("Enter the base64 code: ") >> > code = base64.b64d

Re: python 2 to 3 converter

2019-12-09 Thread Chris Angelico
On Tue, Dec 10, 2019 at 4:41 PM songbird wrote: > > Chris Angelico wrote: > ... > > What if neither works, because there are assumptions that don't work? > > then you get stuck doing it by hand, but you would have > been stuck doing it before for sure by hand so if you can > write something whic

Re: python 2 to 3 converter

2019-12-09 Thread songbird
Chris Angelico wrote: ... > What if neither works, because there are assumptions that don't work? then you get stuck doing it by hand, but you would have been stuck doing it before for sure by hand so if you can write something which might get some of the easy cases done then at least you're sav

Re: python 2 to 3 converter

2019-12-09 Thread Chris Angelico
On Tue, Dec 10, 2019 at 12:15 PM songbird wrote: > > Chris Angelico wrote: > ... > > > > Here's an example piece of code. > > > > sock = socket.socket(...) > > name = input("Enter your username: ") > > code = input("Enter the base64 code: ") > > code = base64.b64decode(code) > > sock.write("""GET

Re: python 2 to 3 converter

2019-12-09 Thread Chris Angelico
On Tue, Dec 10, 2019 at 12:11 PM songbird wrote: > > Rob Gaddi wrote: > ... > > And how exactly do you propose to determine whether the constant I've > > enclosed > > in quotation marks in Python2 represents "text" or "binary data"? Not all > > text > > is words; think of SQL queries. And some

Re: python 2 to 3 converter

2019-12-09 Thread songbird
Chris Angelico wrote: ... > > Here's an example piece of code. > > sock = socket.socket(...) > name = input("Enter your username: ") > code = input("Enter the base64 code: ") > code = base64.b64decode(code) > sock.write("""GET /foo HTTP/1.0 > Authentication: Demo %s/%s > > """ % (name, code)) > mat

Re: python 2 to 3 converter

2019-12-09 Thread songbird
Rob Gaddi wrote: ... > And how exactly do you propose to determine whether the constant I've > enclosed > in quotation marks in Python2 represents "text" or "binary data"? Not all > text > is words; think of SQL queries. And some words are binary data, think SCPI > commands being sent to a s

Re: python 2 to 3 converter

2019-12-09 Thread Rob Gaddi
On 12/9/19 9:55 AM, songbird wrote: jf...@ms4.hinet.net wrote: ... Even string is hard to be handled by the AI:-) Quoted from https://portingguide.readthedocs.io/en/latest/strings.html " ... This means that you need to go through the entire codebase, and decide which value is what type. Unfort

Re: python 2 to 3 converter

2019-12-09 Thread Chris Angelico
On Tue, Dec 10, 2019 at 5:05 AM songbird wrote: > > jf...@ms4.hinet.net wrote: > ... > > Even string is hard to be handled by the AI:-) > > > > Quoted from https://portingguide.readthedocs.io/en/latest/strings.html > > " ... This means that you need to go through the entire codebase, and > > deci

Re: python 2 to 3 converter

2019-12-09 Thread songbird
jf...@ms4.hinet.net wrote: ... > Even string is hard to be handled by the AI:-) > > Quoted from https://portingguide.readthedocs.io/en/latest/strings.html > " ... This means that you need to go through the entire codebase, and decide > which value is what type. Unfortunately, this process generall

Re: python 2 to 3 converter

2019-12-09 Thread songbird
Greg Ewing wrote: > On 8/12/19 9:30 pm, songbird wrote: >>wouldn't it make more sense to just go back and fix the >> converter program than to have to manually convert all this >> python2 code? > > Anything that isn't already fixed by 2to3 is probably > somewhere between very difficult and impo

Re: python 2 to 3 converter

2019-12-08 Thread jfong
Greg Ewing於 2019年12月9日星期一 UTC+8上午6時18分32秒寫道: > On 8/12/19 9:30 pm, songbird wrote: > >wouldn't it make more sense to just go back and fix the > > converter program than to have to manually convert all this > > python2 code? > > Anything that isn't already fixed by 2to3 is probably > somewhere

Re: python 2 to 3 converter

2019-12-08 Thread Greg Ewing
On 8/12/19 9:30 pm, songbird wrote: wouldn't it make more sense to just go back and fix the converter program than to have to manually convert all this python2 code? Anything that isn't already fixed by 2to3 is probably somewhere between very difficult and impossible to fix using an automate

Re: python 2 to 3 converter

2019-12-08 Thread songbird
Chris Angelico wrote: > On Sun, Dec 8, 2019 at 7:36 PM songbird wrote: >> this would be a heck of a lot of fun. > > Then go ahead and do it. i know you're just being flip here and that's fine with me. that said, i'd love to! how big is PyPI? (huge) will it fit on an SSD? (no) my local m

Re: python 2 to 3 converter

2019-12-08 Thread Chris Angelico
On Sun, Dec 8, 2019 at 7:36 PM songbird wrote: > this would be a heck of a lot of fun. Then go ahead and do it. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

python 2 to 3 converter

2019-12-08 Thread songbird
wouldn't it make more sense to just go back and fix the converter program than to have to manually convert all this python2 code? how many small test bits of code from PyPI could be used as templates for patterns to search for that can then be automatically converted and the test rerun? thous