Live data from Hacker News

Python 3: Ten years later

archive.fosdem.org

61–70 of 93 posts

Re: Python 3: Ten years later

#61
I think the conversion would have been faster, especially for people who don't care, if the main distributions collaborated and stopped providing Python 2.x; 99% of software writers would just check out how to write their code in Python 3, or move their code to that version. The other 1% would be people who "knew what they're doing" and custom install whatever version they needed.

Imagine if Ubuntu 14.04 (Trusty) didn't bring Python 2. All devs of relevant stuff would have received a shower of upgrade requests. Maybe 2014 was too early to force this, but I'm sure in 2018 it could have been done with Ubuntu 18.04.

I know this looks like work for the sake of upgrading, without any real benefit for most projects. But I guess it's not wrong either; you just couldn't expect that Qt 3.3 (circa 2004) was distributed 10 years later in Ubuntu 14.04 (Qt is just a library, not a language, but it practically transforms the way you write C++ so it's a valid comparison IMO); however here we are in 2018, 10 years after the release of Python 3, and Python 2 is still the default interpreter in Ubuntu 18.04.

Re: Python 3: Ten years later

#62
post #18

As an outsider who only uses Python when I need a specific tool that's only available through pip: it's still one of my biggest nightmares. Every single time I need to install something with pip on MacOS there is this hour-long struggle with figuring out how to get the correct version of Python (2.7 vs 3) working with the correct version of pip working with the correct version of the library itself. I don't know, I g…

For anything larger than a medium-sized single-file script, I use pipenv. It's basically a tie-in between pip and virtualenv, and in my opinion is ideal for creating isolated environments quickly, intuitively, and reproducibly. I haven't had Python frustrations since starting to use pipenv.

I was not paid for this message :)

Re: Python 3: Ten years later

#63
Please don't rewrite titles, especially to make them more baity. This is in the site guidelines: "Please use the original title, unless it is misleading or linkbait; don't editorialize."

Titles are by far the strongest influence on discussion, so this rule is much more important than it seems.

https://news.ycombinator.com/newsguidelines.html

(Submitted title was "Python 3 Is Now 10 Years Old Was It Worth It?".)

Re: Python 3: Ten years later

#64
post #30

Just one word: typing [1]. Makes life a lot easier. [1]: https://docs.python.org/3/library/typing.html

Two words: typing, mypy [1]

The editor support that I get from typing/mypy is fantastic! It feels like writing in a statically typed language. To me this is by far the most important feature of Python3. It's a godsend for larger/complicated code bases.

[1]: https://github.com/python/mypy

Re: Python 3: Ten years later

#65
post #13
post #6

Earlier quoted context omitted.

...or you could just use the unicode type in Python 2; like: all of my Python 2 software handled languages in other character sets correctly (and yes: this was stress tested often as I have had many many users from China and the Middle East). There was absolutely nothing wrong with Python 2 and Unicode, and if anything Python 3 just made a bunch of stuff impossible to do correctly (in particular encodings for filenam…

You have to be kidding. I don't even need to elaborate, people who actually used Python 2 know what I'm talking about.

[deleted]

Re: Python 3: Ten years later

#66

Earlier quoted context omitted.

We where able to delete so much code when we switched to Python 3. When you integrate with especially Windows system converting unknown text was tricky at best. It’s not that Python 2 couldn’t do it, but the corner cases and error handling was a pain. Trying to guess encoding at runtime was pretty error prone, with Python 3 it just works. Python 3 was a rocky transision, but I never understood the negativity and I’ll…

I think this is largely a second system result. If you want correct unicode handling it's not harder in 2.x than in 3.x. The main reason unicode support was more complex in 2.x for the most part is that many APIs supported working with Bytes and on 3.x that burden is pushed to the API consumer. > Trying to guess encoding at runtime was pretty error prone, with Python 3 it just works. You should not guess on 2.x eithe…

At first blush you would think so, but I know for a fact that Unicode on Windows is not possible to properly handle below Python 3.4.

Python 3’s Unicode handling has been a huge win for cross-platform deployments in my experience. We run a patched version on 3.3 with some backports from 3.4 on millions of machines, and it is actually possible to support non-Latin filesystem paths, where that was just not possible when we were using 2.6.

In terms of an ecosystem, Python 3 forces casual developers to confront Unicode head on, where 2.x the default is to sweep it under the rug.

I’m extremely grateful that a breaking change was made, even if the execution wasn’t perfect.

Re: Python 3: Ten years later

#67

Earlier quoted context omitted.

I don't have a Mac and maybe you've already tried this, but just in case, you can always do python2 -m pip install ... or python3 -m pip install ... to make sure it's running within that particular Python installation. You can use the --user flag to install to your user directory as well, if the system level is annoying.

why is it that the pip command can't handle what it's supposed to do, instead you have to resort to `python3 -m pip install`? Hell, it even breaks itself: pip install --upgrade pip # => pip unusable https://github.com/pypa/pip/issues/5447 https://github.com/pypa/pip/issues/5221 etc

How would pip know if you want python3 or 2?

On Mac, the system uses python2 so pip and python link to py2.

You can change the system -not fun- or wait for apple to upgrade to py3. Ive been waiting a long time.

There are tools like conda that do manage py2 and py3 projects living in harmony.

Re: Python 3: Ten years later

#68
post #18

As an outsider who only uses Python when I need a specific tool that's only available through pip: it's still one of my biggest nightmares. Every single time I need to install something with pip on MacOS there is this hour-long struggle with figuring out how to get the correct version of Python (2.7 vs 3) working with the correct version of pip working with the correct version of the library itself. I don't know, I g…

i highly recommend pyenv to resolve this issue on Mac OS and Linux: https://github.com/pyenv/pyenv

Yep! Pyenv for Python, rbenv for Ruby, NVM for node.

Re: Python 3: Ten years later

#69

I think Python 3 primarily showed that breaking backwards incompatibility across an entire ecosystem is worse than one could have predicted. Even today Python 2 is far from dead. On the other hand the core development team "outsourced" many of the issues that people actually want to have solved to the community like packaging and distribution. Python's biggest downfall is a highly academic approach with slow release…

It's interesting to watch Java doing the same thing at the moment (IHMO). They got obsessed with the runtime size 10 years ago and in solving that we now have a module system that breaks backwards compatibility. But many of the problems we do have are either not being addressed or are not getting serious treatment.

Already we have much of the community still sitting on Java 8 even as the new long term release JDK11 has been made. It wouldn't surprise me at all if JDK8 becomes the Python2 of the java world: 10 years from now, there will still be whole segments of the community using it.

Re: Python 3: Ten years later

#70
post #63

Please don't rewrite titles, especially to make them more baity. This is in the site guidelines: "Please use the original title, unless it is misleading or linkbait; don't editorialize." Titles are by far the strongest influence on discussion, so this rule is much more important than it seems. https://news.ycombinator.com/newsguidelines.html (Submitted title was "Python 3 Is Now 10 Years Old Was It Worth It?".)

In the submission form, have the title field auto populated from the URL.
Post reply on HN