Re: [arch-general] python3 thoughts
The transition is indeed smooth, as least for me. I am just worrying that maybe most python utilities will remain using python2 for a rather long time. Considering the incompatibility in the fundamental print function/statement, I seriously doubt the number of python2 packages that can run under python3 without any modification. Most python programmers are clearly not so interested in the bleeding-edge technologies. That's what makes me frustrated as an Arch user. Best Regards,
Date: Fri, 12 Nov 2010 02:11:56 -0500 From: Isaac Dupree <ml@isaac.cedarswampstudios.org> Subject: Re: [arch-general] python3 thoughts To: General Discussion about Arch Linux <arch-general@archlinux.org> Message-ID: <4CDCE8BC.4080107@isaac.cedarswampstudios.org> Content-Type: text/plain; charset=UTF-8; format=flowed
On 11/12/10 01:51, Auguste Pop wrote:
... I hope python3 won't die this way, so that all the previous efforts in transition to python3 will not go in vain. Maybe we just took the transitional leap too early when nobody is ready except us.
As you note, "nobody is ready except us" -- we are ready -- the pain is not very much. On the flip side, the little pain that we do feel is a really valuable offering to the other more conservative distros: they get to see how it was for us and what the biggest pain points are in practice.
You're also (I think?) making a good point that, at least where upstream projects written in python can run on python3, we as packagers should proactively package them to do so. We should be conscious if we're letting them languish in the doldrums of 2-ness untended.
-Isaac
On Fri, Nov 12, 2010 at 12:46 PM, Auguste Pop <auguste@gmail.com> wrote:
The transition is indeed smooth, as least for me. I am just worrying that maybe most python utilities will remain using python2 for a rather long time.
Considering the incompatibility in the fundamental print function/statement, I seriously doubt the number of python2 packages that can run under python3 without any modification.
Most python programmers are clearly not so interested in the bleeding-edge technologies. That's what makes me frustrated as an Arch user.
most problems are rather easy to workaround... so i don't know why there is so much fuss about py3k. personally, i welcome it; clean up basic language constructs, do it all at once, and make everything more consistent. consistency is a wonderful thing for a developer. even the print statement is easy: print('this is a test') works correctly in python2 and py3k... only when you add multiple args, does it break: print('this is a test', 'so is this') because in python the comma is the tuple operator, not parentheses. all you have to do is join you args together before sending to print. or, just use: sys.stdout.write() thought some changes are more difficult, ultimately, it's not that disruptive imo. it's clearly the path forward; no use in dragging feet. C Anthony
That's nonsense. It's correct that Arch is an advanced user distribution but you can't expect everyone to workaround each py application. Not everyone that use Arch are developers. --- Quis custodiet ipsos custodes? 2010/11/12 C Anthony Risinger <anthony@extof.me>
On Fri, Nov 12, 2010 at 12:46 PM, Auguste Pop <auguste@gmail.com> wrote:
The transition is indeed smooth, as least for me. I am just worrying that maybe most python utilities will remain using python2 for a rather long time.
Considering the incompatibility in the fundamental print function/statement, I seriously doubt the number of python2 packages that can run under python3 without any modification.
Most python programmers are clearly not so interested in the bleeding-edge technologies. That's what makes me frustrated as an Arch user.
most problems are rather easy to workaround... so i don't know why there is so much fuss about py3k. personally, i welcome it; clean up basic language constructs, do it all at once, and make everything more consistent. consistency is a wonderful thing for a developer.
even the print statement is easy:
print('this is a test')
works correctly in python2 and py3k... only when you add multiple args, does it break:
print('this is a test', 'so is this')
because in python the comma is the tuple operator, not parentheses. all you have to do is join you args together before sending to print. or, just use:
sys.stdout.write()
thought some changes are more difficult, ultimately, it's not that disruptive imo. it's clearly the path forward; no use in dragging feet.
C Anthony
On Wed, Nov 17, 2010 at 12:51 PM, Alper KANAT <tunix@raptiye.org> wrote:
That's nonsense.
what is? py3k is nothing more than the completion and/or significant advancement of several items that began in the 2.x tree; this is not new information.
It's correct that Arch is an advanced user distribution but you can't expect everyone to workaround each py application. Not everyone that use Arch are developers.
the thread seems to be more focused on _developers_, and my response reflects this sentiment. i wouldn't expect any user to fix <insert> application, even myself. what i would expect however, is that they can figure out how to run it under python2. C Anthony
On 11/17/2010 01:32 PM, C Anthony Risinger wrote:
On Wed, Nov 17, 2010 at 12:51 PM, Alper KANAT <tunix@raptiye.org> wrote:
That's nonsense.
what is? py3k is nothing more than the completion and/or significant advancement of several items that began in the 2.x tree; this is not new information.
It's correct that Arch is an advanced user distribution but you can't expect everyone to workaround each py application. Not everyone that use Arch are developers.
the thread seems to be more focused on _developers_, and my response reflects this sentiment.
i wouldn't expect any user to fix <insert> application, even myself. what i would expect however, is that they can figure out how to run it under python2.
C Anthony
C Anthony, That does seem to be where some of us are stuck... I can change the #!/usr/bin/python to #!/usr/bin/python2 no sweat, but then when the apps throw further module errors, that is where I get stuck. For example in /usr/share/createrepo/genpkgmetadata.py, running the script with python2 as the executable results in the following error: 01:32 nirvana:/home/backup/rpms> sudo ./data/updt-sign-repo.sh openSUSE_11.0/ sqlite metadata tables found --> updating Traceback (most recent call last): File "/usr/share/createrepo/genpkgmetadata.py", line 29, in <module> import createrepo ImportError: No module named createrepo So for some reason the change has caused python2 to lose all its modules and I know not how to make the find them again :( -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 24/11/10 17:35, David C. Rankin wrote:
On 11/17/2010 01:32 PM, C Anthony Risinger wrote:
On Wed, Nov 17, 2010 at 12:51 PM, Alper KANAT<tunix@raptiye.org> wrote:
That's nonsense.
what is? py3k is nothing more than the completion and/or significant advancement of several items that began in the 2.x tree; this is not new information.
It's correct that Arch is an advanced user distribution but you can't expect everyone to workaround each py application. Not everyone that use Arch are developers.
the thread seems to be more focused on _developers_, and my response reflects this sentiment.
i wouldn't expect any user to fix<insert> application, even myself. what i would expect however, is that they can figure out how to run it under python2.
C Anthony
C Anthony,
That does seem to be where some of us are stuck... I can change the #!/usr/bin/python to #!/usr/bin/python2 no sweat, but then when the apps throw further module errors, that is where I get stuck. For example in /usr/share/createrepo/genpkgmetadata.py, running the script with python2 as the executable results in the following error:
01:32 nirvana:/home/backup/rpms> sudo ./data/updt-sign-repo.sh openSUSE_11.0/ sqlite metadata tables found --> updating
Traceback (most recent call last): File "/usr/share/createrepo/genpkgmetadata.py", line 29, in<module> import createrepo ImportError: No module named createrepo
So for some reason the change has caused python2 to lose all its modules and I know not how to make the find them again :(
Have you rebuild whatever package provides "createrepo" to have its modules available for python-2.7? They are probably still sitting in a python-26 directory... This would have happened with or without the python3 transition. Allan
On 11/24/2010 01:42 AM, Allan McRae wrote:
Have you rebuild whatever package provides "createrepo" to have its modules available for python-2.7? They are probably still sitting in a python-26 directory... This would have happened with or without the python3 transition.
Allan
Good to know that I can hose myself with python in more ways than one all at the same time :p Thanks, I'll hunt & check. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On 11/12/2010 11:46 AM, Auguste Pop wrote:
Considering the incompatibility in the fundamental print function/statement, I seriously doubt the number of python2 packages that can run under python3 without any modification.
But that's the easy part. 2to3 can automatically convert a lot of things, like print x to print(x), xrange(y) to range(y) and range(z) to list(range(z)): 2to3 -w somefile.py # converts the file to python 3 and also backs up the original References: http://docs.python.org/library/2to3.html http://diveintopython3.org/porting-code-to-python-3-with-2to3.html
I don't know what you see under a smooth transition, but I've had to edit the first line of a lot of apps.. (#!/usr/bin/python to #!/usr/bin/python2). No big trouble, but trouble nonetheless. Adrian 2010/11/12 Brendan Long <korin43@gmail.com>
On 11/12/2010 11:46 AM, Auguste Pop wrote:
Considering the incompatibility in the fundamental print function/statement, I seriously doubt the number of python2 packages that can run under python3 without any modification.
But that's the easy part. 2to3 can automatically convert a lot of things, like print x to print(x), xrange(y) to range(y) and range(z) to list(range(z)):
2to3 -w somefile.py # converts the file to python 3 and also backs up the original
References: http://docs.python.org/library/2to3.html http://diveintopython3.org/porting-code-to-python-3-with-2to3.html
Brendan Long wrote:
.... References: http://docs.python.org/library/2to3.html http://diveintopython3.org/porting-code-to-python-3-with-2to3.html
Another reference .... for things to consider when choosing Python2 or Python3 ... http://wiki.python.org/moin/Python2orPython3 -- Stanley C. Kitching Human Being Phoenix, Arizona
participants (8)
-
Allan McRae
-
Alper KANAT
-
Auguste Pop
-
Brendan Long
-
C Anthony Risinger
-
Cousin Stanley
-
David C. Rankin
-
howitzer@archlinux.us