Re: python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Chris, On Mon, Jun 17, 2019 at 9:55 AM Chris Angelico wrote: > > On Mon, Jun 17, 2019 at 11:15 PM Igor Korot wrote: > > > > Hi, Chris et al, > > > > On Mon, Jun 17, 2019 at 8:00 AM Chris Angelico wrote: > > > > > > On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans wrote: > > > > > > > > On 1

Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 11:15 PM Igor Korot wrote: > > Hi, Chris et al, > > On Mon, Jun 17, 2019 at 8:00 AM Chris Angelico wrote: > > > > On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans wrote: > > > > > > On 17/06/2019 15.14, Igor Korot wrote: > > > > Hi, > > > > Is there a place where there is

Re: python 2 to 3 conversion

2019-06-17 Thread Grant Edwards
On 2019-06-17, Igor Korot wrote: > So, how do I write the code compatible with both python 2 and python 3 > in this case? Writing 2/3 compatible code that deals with bytes is difficult. For example: Python 2.7.15 (default, Sep 12 2018, 15:19:18) >>> bytes(5) '5' >>> b'1234'[0]

Re: python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Chris et al, On Mon, Jun 17, 2019 at 8:00 AM Chris Angelico wrote: > > On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans wrote: > > > > On 17/06/2019 15.14, Igor Korot wrote: > > > Hi, > > > Is there a place where there is a full list of incompatibilities between > > > python 2 and python 3 is

Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 10:50 PM Thomas Jollans wrote: > > On 17/06/2019 15.14, Igor Korot wrote: > > Hi, > > Is there a place where there is a full list of incompatibilities between > > python 2 and python 3 is available and how to fix them? > > ‘What’s new in Python 3.0’ is a good starting point

Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 10:45 PM Igor Korot wrote: > > Hi, Chris, > > On Mon, Jun 17, 2019 at 7:31 AM Chris Angelico wrote: > > > > On Mon, Jun 17, 2019 at 10:15 PM Igor Korot wrote: > > > > > > Hi, > > > Is there a place where there is a full list of incompatibilities between > > > python 2 and

Re: python 2 to 3 conversion

2019-06-17 Thread Thomas Jollans
On 17/06/2019 15.14, Igor Korot wrote: > Hi, > Is there a place where there is a full list of incompatibilities between > python 2 and python 3 is available and how to fix them? ‘What’s new in Python 3.0’ is a good starting point https://docs.python.org/3/whatsnew/3.0.html It doesn’t list all st

Re: python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Chris, On Mon, Jun 17, 2019 at 7:31 AM Chris Angelico wrote: > > On Mon, Jun 17, 2019 at 10:15 PM Igor Korot wrote: > > > > Hi, > > Is there a place where there is a full list of incompatibilities between > > python 2 and python 3 is available and how to fix them? > > > > I'm looking for a w

Re: python 2 to 3 conversion

2019-06-17 Thread Chris Angelico
On Mon, Jun 17, 2019 at 10:15 PM Igor Korot wrote: > > Hi, > Is there a place where there is a full list of incompatibilities between > python 2 and python 3 is available and how to fix them? > > I'm looking for a way to fix following code, which runs perfectly with python > 2 > (and make it work

python 2 to 3 conversion

2019-06-17 Thread Igor Korot
Hi, Is there a place where there is a full list of incompatibilities between python 2 and python 3 is available and how to fix them? I'm looking for a way to fix following code, which runs perfectly with python 2 (and make it work with both python 2 and python 3): if bytes[0:16].tostring() != '':

Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 12:05 PM, Wildman via Python-list wrote: > On Tue, 20 Feb 2018 10:55:28 +1100, Chris Angelico wrote: > >> The given homepage URL is >> http://alastairs-place.net/projects/netifaces/ - is that the right >> one? >> >> ChrisA > > Yes, that is the right one. Now I'm feeling a

Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 10:55:28 +1100, Chris Angelico wrote: > The given homepage URL is > http://alastairs-place.net/projects/netifaces/ - is that the right > one? > > ChrisA Yes, that is the right one. Now I'm feeling a little stupid. I should have remembered that many python library package nam

Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 10:09 AM, Wildman via Python-list wrote: > Yes, you are correct. Third-party pip packages are always > a no-no. > > Speaking of which, there is a library called Netifaces that > will easily do exactly what I want with a few lines of code. > But, it is not to be found in an

Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 05:31:27 +1100, Chris Angelico wrote: > On Tue, Feb 20, 2018 at 3:49 AM, Wildman via Python-list > wrote: >> On Mon, 19 Feb 2018 12:32:49 +, Rhodri James wrote: >> >>> On 18/02/18 16:18, Wildman via Python-list wrote: > But that's only going to show one (uplink) addres

Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 05:39:15 +1100, Chris Angelico wrote: > On Tue, Feb 20, 2018 at 3:53 AM, Wildman via Python-list > wrote: >> On Tue, 20 Feb 2018 02:26:19 +1100, Chris Angelico wrote: >> >>> * Opaque IOCTLs >> >> Would you mind to elaborate a little about your >> concerns? > > Look at your or

Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 3:53 AM, Wildman via Python-list wrote: > On Tue, 20 Feb 2018 02:26:19 +1100, Chris Angelico wrote: > >> * Opaque IOCTLs > > Would you mind to elaborate a little about your > concerns? Look at your original code: it's impossible to figure out what it's doing or whether it'

Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Tue, Feb 20, 2018 at 3:49 AM, Wildman via Python-list wrote: > On Mon, 19 Feb 2018 12:32:49 +, Rhodri James wrote: > >> On 18/02/18 16:18, Wildman via Python-list wrote: But that's only going to show one (uplink) address. If I needed to get ALL addresses for ALL network adapters,

Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Tue, 20 Feb 2018 02:26:19 +1100, Chris Angelico wrote: > * Opaque IOCTLs Would you mind to elaborate a little about your concerns? -- GNU/Linux user #557453 "There are only 10 types of people in the world... those who understand Binary... and those who don't." -Spike -- https://mail.pyth

Re: Python 2 to 3 Conversion

2018-02-19 Thread Wildman via Python-list
On Mon, 19 Feb 2018 12:32:49 +, Rhodri James wrote: > On 18/02/18 16:18, Wildman via Python-list wrote: >>> But that's only going to show one (uplink) address. If I needed to get >>> ALL addresses for ALL network adapters, I'd either look for a library, >>> and if one wasn't easily found, I'd

Re: Python 2 to 3 Conversion

2018-02-19 Thread Chris Angelico
On Mon, Feb 19, 2018 at 11:32 PM, Rhodri James wrote: > On 18/02/18 16:18, Wildman via Python-list wrote: >>> >>> But that's only going to show one (uplink) address. If I needed to get >>> ALL addresses for ALL network adapters, I'd either look for a library, >>> and if one wasn't easily found, I'

Re: Python 2 to 3 Conversion

2018-02-19 Thread Rhodri James
On 18/02/18 16:18, Wildman via Python-list wrote: But that's only going to show one (uplink) address. If I needed to get ALL addresses for ALL network adapters, I'd either look for a library, and if one wasn't easily found, I'd shell out to the "ip" command and parse its output.:) I considered

Re: Python 2 to 3 Conversion

2018-02-18 Thread Wildman via Python-list
On Sun, 18 Feb 2018 20:51:18 +1100, Chris Angelico wrote: > On Sun, Feb 18, 2018 at 4:35 AM, Wildman via Python-list > wrote: >> Thanks to Chris and Ben. Your suggestions were slightly >> different but both worked equally well, although I don't >> understand how that can be so. >> >>> struct.pac

Re: Python 2 to 3 Conversion

2018-02-18 Thread Chris Angelico
On Sun, Feb 18, 2018 at 4:35 AM, Wildman via Python-list wrote: > Thanks to Chris and Ben. Your suggestions were slightly > different but both worked equally well, although I don't > understand how that can be so. > >> struct.pack('256s', ifname[:15].encode('ascii')) >> struct.pack('256s', ifname

Re: Python 2 to 3 Conversion

2018-02-18 Thread Wildman via Python-list
Thanks to Chris and Ben. Your suggestions were slightly different but both worked equally well, although I don't understand how that can be so. > struct.pack('256s', ifname[:15].encode('ascii')) > struct.pack('256s', ifname.encode('ascii')) I was looking for a reliable way to determine the IP ad

Re: Python 2 to 3 Conversion

2018-02-16 Thread Ben Finney
Wildman via Python-list writes: > def get_ip_address(ifname): > s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > return socket.inet_ntoa(fcntl.ioctl( > s.fileno(), > 0x8915, # SIOCGIFADDR > struct.pack('256s', ifname[:15]) > )[20:24]) > print(get_ip_

Re: Python 2 to 3 Conversion

2018-02-16 Thread Chris Angelico
On Sat, Feb 17, 2018 at 4:15 PM, Wildman via Python-list wrote: > I have a bit of code I found on the web that will return > the ip address of the named network interface. The code > is for Python 2 and it runs fine. But, I want to use the > code with Python 3. Below is the code followed by the

Python 2 to 3 Conversion

2018-02-16 Thread Wildman via Python-list
I have a bit of code I found on the web that will return the ip address of the named network interface. The code is for Python 2 and it runs fine. But, I want to use the code with Python 3. Below is the code followed by the error message. Suggestions appreciated. #!/usr/bin/env python3 import

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-20 Thread Chris Angelico
On Sat, Mar 21, 2015 at 2:42 AM, Mark Lawrence wrote: > Please don't feed the RUE. Yeah, you'll RUE the day you get sucked into a conversation with a troll... ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-20 Thread Mark Lawrence
On 20/03/2015 14:59, Mario Figueiredo wrote: On Fri, 20 Mar 2015 02:40:26 -0700 (PDT), wxjmfa...@gmail.com wrote: Python 3.x is excellent. Probably, the best language to show a poor and buggy Unicode implementation (Character Encoding Model). When I think other computer languages or Unicode re

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-20 Thread Mario Figueiredo
On Fri, 20 Mar 2015 15:59:01 +0100, Mario Figueiredo wrote: > >Ah. So you are on the Python 3 unicode support sucks bandwagon too? > >Bet you guys have a whole lot of fun there. Rave parties, trashing, >getting mad at something. Sounds fun. > >Over here, on the Python 3 unicode support is just fi

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-20 Thread Mario Figueiredo
On Fri, 20 Mar 2015 02:40:26 -0700 (PDT), wxjmfa...@gmail.com wrote: > >Python 3.x is excellent. >Probably, the best language to show a >poor and buggy Unicode implementation >(Character Encoding Model). > >When I think other computer languages or >Unicode related tools are all doing wrong. >That's

Re: Python 2 to 3 conversion - embrace the pain

2015-03-19 Thread Mario Figueiredo
On Thu, 19 Mar 2015 22:03:02 -0400, Dennis Lee Bieber wrote: >On Thu, 19 Mar 2015 16:23:04 -0700, Paul Rubin >declaimed the following: > >>Steven D'Aprano writes: >> >>> Anyone remember the big backwards incompatible changes made to Visual >>> Basic? How long did that take to settle down after

Re: Python 2 to 3 conversion - embrace the pain

2015-03-19 Thread Paul Rubin
Steven D'Aprano writes: >> better to make a fork of the language > You mean like Python 3? No I mean like C to C++, or Lisp to Clojure, etc. Or if you prefer, C to OpenCL or maybe even C++ to Java or C to Go. If you're going to break old code, go big or go home ;-). > There are still people us

Re: Python 2 to 3 conversion - embrace the pain

2015-03-19 Thread Steven D'Aprano
On Thu, 19 Mar 2015 03:35 am, Paul Rubin wrote: > Steven D'Aprano writes: >> The two weeks we lost upgrading from Python 2.6 to 2.7 is just the >> normal upgrade pains you always have to expect from any major project, > > Wait, what happened between 2.6 and 2.7 that took you two weeks of > upgra

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-19 Thread Michael Torrie
On 03/19/2015 04:16 PM, John Nagle wrote: > On 3/16/2015 6:46 PM, Michael Torrie wrote: >> Since Python 3's adoption is directly impacted by package managers and >> curated repos (or lack thereof), I feel justified in continuing this >> thread just a bit farther. > >Since denying the problem d

Re: Python 2 to 3 conversion - embrace the pain

2015-03-18 Thread Paul Rubin
Steven D'Aprano writes: > The two weeks we lost upgrading from Python 2.6 to 2.7 is just the > normal upgrade pains you always have to expect from any major project, Wait, what happened between 2.6 and 2.7 that took you two weeks of upgrading? -- https://mail.python.org/mailman/listinfo/python-l

Re: Python 2 to 3 conversion - embrace the pain

2015-03-18 Thread Rustom Mody
On Wednesday, March 18, 2015 at 4:23:37 PM UTC+5:30, Steven D'Aprano wrote: > On Wed, 18 Mar 2015 08:11 pm, Ned Deily wrote: > > > In any case, of the two problems noted with Python itself, there is only > > one that appears to be Python 3 related.  That's still not good but I > > think it would b

Re: Python 2 to 3 conversion - embrace the pain

2015-03-18 Thread Steven D'Aprano
On Wed, 18 Mar 2015 08:11 pm, Ned Deily wrote: > In any case, of the two problems noted with Python itself, there is only > one that appears to be Python 3 related.  That's still not good but I > think it would be fairer to ascribe a good chunk of the pain you've > experienced to the more common p

Re: Python 2 to 3 conversion - embrace the pain

2015-03-18 Thread Ned Deily
In article , John Nagle wrote: >If only that were true. Look what I'm reporting bugs on: > > ssl - a core Python module. I assume you're referring to http://bugs.python.org/issue23476. It seems to me that the issue there was not in Python but due to a shortcoming in OpenSSL itself.

Re: Python 2 to 3 conversion - embrace the pain

2015-03-18 Thread Mark Lawrence
On 18/03/2015 06:37, John Nagle wrote: On 3/15/2015 4:43 PM, Roy Smith wrote: In article , Mario Figueiredo wrote: What makes you think your anecdotal bugs constitute any sort of evidence this programming language isn't ready to be used by the public? There's several levels of "ready". I

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread John Nagle
On 3/15/2015 4:43 PM, Roy Smith wrote: > In article , > Mario Figueiredo wrote: > >> What makes you think your anecdotal bugs constitute any sort of >> evidence this programming language isn't ready to be used by the >> public? > > There's several levels of "ready". > > I'm sure the core langu

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Mario Figueiredo
On Tue, 17 Mar 2015 04:36:01 +, Mark Lawrence wrote: > >Of course we could avoid all of these problems if we were to bring back >the mainframe or mini and the dumb terminal. > >Take cover, incoming :) No kidding. Installing only the software you coded (or from source) may be a little too mu

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Mark Lawrence
On 17/03/2015 22:36, Dennis Lee Bieber wrote: On Tue, 17 Mar 2015 14:50:57 + (UTC), Grant Edwards declaimed the following: On 2015-03-17, Mark Lawrence wrote: Of course we could avoid all of these problems if we were to bring back the mainframe or mini and the dumb terminal. We did, e

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Cameron Simpson
On 17Mar2015 05:30, Mario Figueiredo wrote: On Tue, 17 Mar 2015 14:42:42 +1100, Ben Finney wrote: Mario Figueiredo writes: On Tue, 17 Mar 2015 09:02:38 +1100, Chris Angelico wrote: >Imagine you need a PostgreSQL database for your Python application - >which also means you need psycopg2, of

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Michael Torrie
On 03/17/2015 02:39 AM, Steven D'Aprano wrote: > On Tuesday 17 March 2015 12:46, Michael Torrie wrote: > >> Python3 can be installed from Software Collections (and that is somewhat >> reasonable), but it won't integrate by default, so you can't use >> #!/usr/bin/python3 in your apps by default wit

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Grant Edwards
On 2015-03-17, Mark Lawrence wrote: > Of course we could avoid all of these problems if we were to bring back > the mainframe or mini and the dumb terminal. We did, except we made the terminal smarter and prettier and called it a "web browser" and we call the mainframe a "web server". -- Gran

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Mario Figueiredo
On Tue, 17 Mar 2015 22:26:58 +1100, Steven D'Aprano wrote: > >> >> Can you give an example? I wouldn't count things like gets, which >> aren't as much changes in the language, as recognition that using it was >> buggy from the start. > >That's exactly the point. `gets` is dangerous and needs to

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Steven D'Aprano
On Tue, 17 Mar 2015 09:36 am, Paul Rubin wrote: > Steven D'Aprano writes: [...] >> If we were designing Python from scratch today, here are some of the >> changes we would certainly make: [mostly good changes] > > I agree with most of those changes and I'd add some of my own that are > even more

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Steven D'Aprano
On Tuesday 17 March 2015 12:46, Michael Torrie wrote: > Python3 can be installed from Software Collections (and that is somewhat > reasonable), but it won't integrate by default, so you can't use > #!/usr/bin/python3 in your apps by default without altering the system > paths. If RedHat installs

Re: Python 2 to 3 conversion - embrace the pain

2015-03-17 Thread Steven D'Aprano
On Tuesday 17 March 2015 14:33, Michael Torrie wrote: > On 03/16/2015 09:04 PM, Mario Figueiredo wrote: >> Are you saying this is a problem for any developer? Especially >> considering this is a one-time operation... >> >> Or maybe you mean lazy developers. But lazy developers are an edge >> case

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Cameron Simpson
On 17Mar2015 07:36, Steven D'Aprano wrote: I must admit that the Linux filesystem layout strikes me as awfully pedantic and fussy. We're happy to use our home directory as an undifferentiated bag with no structure, dumping binaries, scripts, documents, data files, config files and everything el

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mark Lawrence
On 17/03/2015 04:26, Mario Figueiredo wrote: On Tue, 17 Mar 2015 14:49:36 +1100, Chris Angelico wrote: The simpler you can make those instructions, the easier it is for people to use your program. So on Windows, that probably means you have to bundle everything into a big fat .exe or .msi ins

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mario Figueiredo
On Tue, 17 Mar 2015 14:42:42 +1100, Ben Finney wrote: >Mario Figueiredo writes: > >> On Tue, 17 Mar 2015 09:02:38 +1100, Chris Angelico >> wrote: >> > >> >Imagine you need a PostgreSQL database for your Python application - >> >which also means you need psycopg2, of course. How do you go about

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mario Figueiredo
On Tue, 17 Mar 2015 14:49:36 +1100, Chris Angelico wrote: > >The simpler you can make those instructions, the easier it is for >people to use your program. So on Windows, that probably means you >have to bundle everything into a big fat .exe or .msi installer, which >is what leads to DLL Hell whe

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Chris Angelico
On Tue, Mar 17, 2015 at 2:04 PM, Mario Figueiredo wrote: > On Tue, 17 Mar 2015 09:02:38 +1100, Chris Angelico > wrote: >> >>Imagine you need a >>PostgreSQL database for your Python application - which also means you >>need psycopg2, of course. How do you go about writing installation >>instructio

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Alexander
Hi all, Surely you did not look at the package manager and package assortment of OpenBSD. It is actually a really good example of how package repository can be both reliable, easy to use and up to date. Also, what sort of quality can be expected from a piece of software, whose author is unable t

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Ben Finney
Mario Figueiredo writes: > On Tue, 17 Mar 2015 09:02:38 +1100, Chris Angelico > wrote: > > > >Imagine you need a PostgreSQL database for your Python application - > >which also means you need psycopg2, of course. How do you go about > >writing installation instructions? > > > >* WINDOWS * > >1)

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 09:04 PM, Mario Figueiredo wrote: > Are you saying this is a problem for any developer? Especially > considering this is a one-time operation... > > Or maybe you mean lazy developers. But lazy developers are an edge > case not worth being catered for. I guess I'm saying the package

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mark Lawrence
On 17/03/2015 03:05, Michael Torrie wrote: On 03/16/2015 09:01 PM, Mark Lawrence wrote: Reading this makes me realise how lucky I am not having to worry about such issues. How so? I don't work due to ill health. I use Python at home on Windows purely for my own needs which pip now covers,

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mario Figueiredo
On Mon, 16 Mar 2015 21:05:03 -0600, Michael Torrie wrote: >On 03/16/2015 09:01 PM, Mark Lawrence wrote: >> Reading this makes me realise how lucky I am not having to worry about >> such issues. > >How so? Speaking for myself (I know you didn't ask me) what you call the "dismal world of windows"

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 08:45 PM, Paul Rubin wrote: > Chris Angelico writes: >> On Tue, Mar 17, 2015 at 12:46 PM, Michael Torrie wrote: >>> But after 20 years, the package manager idea certain has revealed many >>> shortcomings (in short, it sucks in many ways). ... >> The hardest part is managing library

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 09:01 PM, Mark Lawrence wrote: > Reading this makes me realise how lucky I am not having to worry about > such issues. How so? -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mario Figueiredo
On Tue, 17 Mar 2015 09:02:38 +1100, Chris Angelico wrote: > >Imagine you need a >PostgreSQL database for your Python application - which also means you >need psycopg2, of course. How do you go about writing installation >instructions? > >* WINDOWS * >1) Install the latest Python 3 from https://www

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mark Lawrence
On 17/03/2015 02:51, Michael Torrie wrote: On 03/16/2015 08:40 PM, Ben Finney wrote: Thanks again. This is an important and difficult problem, with competing forces at play, and I am not at all satisfied with the current state of packaging. I agree. Though I like the concept of package manage

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 08:40 PM, Ben Finney wrote: > Thanks again. This is an important and difficult problem, with competing > forces at play, and I am not at all satisfied with the current state of > packaging. I agree. Though I like the concept of package managers and curated repos, compared to the dis

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Paul Rubin
Chris Angelico writes: > On Tue, Mar 17, 2015 at 12:46 PM, Michael Torrie wrote: >> But after 20 years, the package manager idea certain has revealed many >> shortcomings (in short, it sucks in many ways). ... > The hardest part is managing library versions, and that's always going > to be a prob

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Ben Finney
Thanks for discussing this, Michael. Michael Torrie writes: > For developers things are even more grim. Package managers certainly > don't work so well for third-party apps like VirtualBox, LibreOffice, > Firefox, etc. Part of the issue is the multiple moving targets distros > present in terms o

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Terry Reedy
On 3/16/2015 6:36 PM, Paul Rubin wrote: Do you know if any of the big Python shops (Google maybe?) are using Python 3 these days? LibreOffice uses Python3.3 (or later, don't know) both for internal scripting and the Python bridge. The FSR unicode that works everywhere for all codepoints had

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mark Lawrence
On 16/03/2015 22:02, Chris Angelico wrote: On Tue, Mar 17, 2015 at 4:20 AM, Michael Torrie wrote: A bit off topic here, but all of this highlights major weaknesses in the Linux software distribution model. While we Linux nerds like to poke fun at Windows for not even having a proper package man

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 02:36 PM, Steven D'Aprano wrote: > I'm sorry, that makes no sense to me. What does it matter whether Python3 is > installed to /opt or /usr or /bin or /who/the/feck/cares, so long as your > application runs when you run it? It's just another dependency, and no more > than one call to

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 07:57 PM, Chris Angelico wrote: > But the solution isn't necessarily to throw out the packaging system. > All you need is to expand it. Yes. And of course that's exactly what Poettering is talking about in his paper. Despite what many think of him, he's a deep thinker and it's wor

Re: [OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Chris Angelico
On Tue, Mar 17, 2015 at 12:46 PM, Michael Torrie wrote: > But after 20 years, the package manager idea certain has revealed many > shortcomings (in short, it sucks in many ways). Package managers work > great for setting up the core distro, and also if the packages you need > are in the repos. D

[OT] Weaknesses of distro package managers - was Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
Since Python 3's adoption is directly impacted by package managers and curated repos (or lack thereof), I feel justified in continuing this thread just a bit farther. On 03/16/2015 04:02 PM, Chris Angelico wrote: > It most assuredly does NOT suck for end users. Apart from issues of > naming (grab

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Paul Rubin
Steven D'Aprano writes: >> Why did the changes have to be introduced at all? > For the same reason any improvement and functional update is > introduced. To make a better language. There comes a point when you decide that maintaining existing code is important enough that you have to stop breakin

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Chris Angelico
On Tue, Mar 17, 2015 at 4:20 AM, Michael Torrie wrote: > A bit off topic here, but all of this highlights major weaknesses in the > Linux software distribution model. While we Linux nerds like to poke fun > at Windows for not even having a proper package manager until Windows > 10, in fact the pac

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Steven D'Aprano
On Tue, 17 Mar 2015 04:20 am, Michael Torrie wrote: > On 03/16/2015 03:13 AM, INADA Naoki wrote: >> I think application developers should use *only* Python 3 from this year. >> If we start moving, more library developers will be able to start >> writing Python 3 only code from next year. > > An a

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread INADA Naoki
On Tue, Mar 17, 2015 at 2:47 AM, Terry Reedy wrote: > On 3/16/2015 5:13 AM, INADA Naoki wrote: > >> Another experience is porting Flask application in my company from >> Python 2 to Python 3. >> It has 26k lines of code and 7.6k lines of tests. >> >> Since we don't need to support both of PY2 and

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Mark Lawrence
On 16/03/2015 17:47, Terry Reedy wrote: On 3/16/2015 5:13 AM, INADA Naoki wrote: Another experience is porting Flask application in my company from Python 2 to Python 3. It has 26k lines of code and 7.6k lines of tests. Since we don't need to support both of PY2 and PY3, we used 2to3. 2to3 cha

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Terry Reedy
On 3/16/2015 4:31 AM, Paul Rubin wrote: sure why numpy couldn't go in the stdlib: does it change all that fast? First there was Numerical Python, the first killer app (though a library) for Python. Then there was was NumArray by a competing group, with some not-quite forward compatible chan

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Terry Reedy
On 3/16/2015 5:13 AM, INADA Naoki wrote: Another experience is porting Flask application in my company from Python 2 to Python 3. It has 26k lines of code and 7.6k lines of tests. Since we don't need to support both of PY2 and PY3, we used 2to3. 2to3 changes 740 lines. That is less than 3% of

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Michael Torrie
On 03/16/2015 03:13 AM, INADA Naoki wrote: > I think application developers should use *only* Python 3 from this year. > If we start moving, more library developers will be able to start > writing Python 3 only code from next year. An admirable sentiment, but I'm currently running the latest RHEL

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Steven D'Aprano
On Mon, 16 Mar 2015 07:25 pm, Paul Rubin wrote: > Steven D'Aprano writes: >> It may, or may not, turn out that in hindsight there might have been >> better ways to manage the Python2-3 transaction. Let's be honest, a lot >> of the changes could have been introduced incrementally... > > Why did t

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Chris Angelico
On Tue, Mar 17, 2015 at 12:05 AM, Steven D'Aprano wrote: > Of course, "problem" seems to be relative. PHP culture seems to accept that > code will break when you do a minor upgrade, and it's no big deal to do a > search-and-replace and rename your functions. The same thing would be > considered un

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Steven D'Aprano
On Mon, 16 Mar 2015 07:31 pm, Paul Rubin wrote: > Steven D'Aprano writes: >> The std lib is *batteries* included. If you need a nuclear reactor, you >> turn to third-party frameworks and libraries like Twisted, Zope, numpy, >> PLY, etc. > > I always thought twisted and zope were monstrosities.

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Steven D'Aprano
INADA Naoki wrote: > I think application developers should use only Python 3 from this year. > If we start moving, more library developers will be able to start > writing Python 3 only code from next year. Where this is possible, that is an excellent idea. Alas, too many (Linux) developers insis

Re: You must register a new account to report a bug (was: Python 2 to 3 conversion - embrace the pain)

2015-03-16 Thread Gene Heskett
On Monday 16 March 2015 02:17:44 Ben Finney wrote: > Cameron Simpson writes: > > To quote Graham Dumpleton: > > > > For years have seen people make vague grumbles about something not > > working with mod_wsgi. Not one ever reported bug or described > > problem. > > Hmm. How easy is it for someo

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Paul Rubin
Terry Reedy writes: > Every change potentially breaks something. (How would you have > changed 1/2 from 0 to .5 without breaking anything?) I would not have changed that. It was an ill-advised change that broke things unnecessarily. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread INADA Naoki
google-api-client has ported from PY2 to PY2/3 recently. https://github.com/google/google-api-python-client It has 4000 lines of code and 3200 lines of tests. It is legacy library. It is indented by 2 spaces since it was created before Google changes their coding style. There are two major pull

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Terry Reedy
On 3/16/2015 1:07 AM, Paul Rubin wrote: I saved a quote from Hacker News a while back (I don't know who the author is): "You know why I'm not running python 3? > Because it doesn't solve a single problem I have. Quite possibly true. >It doesn't solve anyone's problems. It

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Chris Angelico
On Mon, Mar 16, 2015 at 6:56 PM, Steven D'Aprano wrote: > [ a whole lot of stuff that I agree with, and then ... ] > Module renames could be handled via stub modules. Even Unicode strings could > hypothetically have been added via a __future__ import. This part I don't agree with. The problem wit

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Paul Rubin
Steven D'Aprano writes: > The std lib is *batteries* included. If you need a nuclear reactor, you turn > to third-party frameworks and libraries like Twisted, Zope, numpy, PLY, etc. I always thought twisted and zope were monstrosities. I've used threads instead of twisted and various other pos

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Paul Rubin
Steven D'Aprano writes: > It may, or may not, turn out that in hindsight there might have been better > ways to manage the Python2-3 transaction. Let's be honest, a lot of the > changes could have been introduced incrementally... Why did the changes have to be introduced at all? > I suspect th

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Kishan Thobhani
I believe we push towards accepting new paradigms like python 3. If bugs were found on libraries used in older context were probably because there wasn't a need of particular feature. & that is how eventually a software becomes a legacy. There are times when we might want to re-use this library

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Kishan Thobhani
I believe we push towards accepting new paradigms like python 3. If bugs were found on libraries used in older context were probably because there wasn't a need of particular feature. & that is how eventually a software becomes a legacy. There are times when we might want to re-use this library or

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Steven D'Aprano
On Monday 16 March 2015 17:17, Paul Rubin wrote: > Chris Angelico writes: >> Ah but it isn't Py3 that's all about being first - it's the latest >> version of some third-party module. > > You know, one of the attractions of Python used to be that it came with > a powerful enough standard library

Re: Python 2 to 3 conversion - embrace the pain

2015-03-16 Thread Steven D'Aprano
On Monday 16 March 2015 16:39, Chris Angelico wrote: > On Mon, Mar 16, 2015 at 4:07 PM, Paul Rubin > wrote: >> Python 2 is by now pretty solid and its users don't feel like beta >> testers any more. If you're saying using Python 3 by contrast means >> "being first" and "reporting bugs", that bas

Re: You must register a new account to report a bug (was: Python 2 to 3 conversion - embrace the pain)

2015-03-15 Thread Devin Jeanpierre
On Sun, Mar 15, 2015 at 11:17 PM, Ben Finney wrote: > Sadly becoming the norm. People will run a software project and just > assume that users will be willing to go through a registration process > for every project just to report a bug. Registering for github is a lot easier than creating a repr

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Paul Rubin
Chris Angelico writes: > Ah but it isn't Py3 that's all about being first - it's the latest > version of some third-party module. You know, one of the attractions of Python used to be that it came with a powerful enough standard library that you didn't really need third party modules very often.

You must register a new account to report a bug (was: Python 2 to 3 conversion - embrace the pain)

2015-03-15 Thread Ben Finney
Cameron Simpson writes: > To quote Graham Dumpleton: > > For years have seen people make vague grumbles about something not > working with mod_wsgi. Not one ever reported bug or described problem. Hmm. How easy is it for someone who, say, an hour ago had no idea they would ever want to contact

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Chris Angelico
On Mon, Mar 16, 2015 at 4:07 PM, Paul Rubin wrote: > Python 2 is by now pretty solid and its users don't feel like beta > testers any more. If you're saying using Python 3 by contrast means > "being first" and "reporting bugs", that basically translates to "stay > away from it except for experime

  1   2   >