Live data from Hacker News

Python 3.11

docs.python.org

21–30 of 156 posts

Re: Python 3.11

#21
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

i sympathize.

the problem is apple. they are (understandably) refusing to ship an up-to-date global python interpreter with macOS. not only that, they aren't removing the default 2.7 that they ship.

macOS Big Sur ships Python 2.7. ha. ha. ha.

none of the proposed "virtual environments" solutions are going to rescue you when you operate globally at the OS-level and not in a sandbox.

been there.

Re: Python 3.11

#22
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

Using Python 2 is a big part of the problem. Modern Python 3 is a lot nicer. Also you're much better off if each Python project has its own virtual environment using the venv module.

[deleted]

Re: Python 3.11

#23
post #3

This is just a change log its better to link to the 3.11 what’s new: https://docs.python.org/3.11/whatsnew/3.11.html

Between this link and the OP, we're seeing the first improvements to drop from Mark Shannon's Microsoft-funded full-time work on CPython optimization, alongside Eric Snow and Guido van Rossum:

https://www.theregister.com/2021/05/19/faster_python_mark_sh...

https://github.com/markshannon/faster-cpython/blob/master/pl... - indicates that this is step 2 of 4, where the forthcoming steps actually plan to introduce JIT compilation!

From the OP Changelog:

- bpo-44590: All necessary data for executing a Python function (local variables, stack, etc) is now kept in a per-thread stack. Frame objects are lazily allocated on demand. This increases performance by about 7% on the standard benchmark suite. Introspection and debugging are unaffected as frame objects are always available when needed. Patch by Mark Shannon.

And from the What's New:

- “Zero-cost” exceptions are implemented. The cost of try statements is almost eliminated when no exception is raised. (Contributed by Mark Shannon in bpo-40222.)

- Method calls with keywords are now faster due to bytecode changes which avoid creating bound method instances. Previously, this optimization was applied only to method calls with purely positional arguments. (Contributed by Ken Jin and Mark Shannon in bpo-26110, based on ideas implemented in PyPy.)

Really, really exciting beginnings. I can't wait to see what's next!

Re: Python 3.11

#24
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

I use the Anaconda distribution. I can create environments containing any version of Python, like this:

    conda create -n myEnv python=2.7
    conda activate myEnv
I think the problem is that unless someone already knew Python, they probably wouldn't understand environments, so their first thought would be to somehow install another version of Python and replace the system Python, or to use a switcher to switch between versions. That would be my first intuition too. (and I believe that's how Ruby works, via RVM).

But Python works just a little bit differently in that it advocates for the use of its own environments to isolate dependencies. I'll have to admit it is not super intuitive (I already have a system package manager (apt, brew, etc.) and I have Docker containers -- why do I need another yet another environment?) but over time I've just accepted it for what it is. It's a Python convention.

Re: Python 3.11

#26
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

Please enough of this. Trying spending 2 minutes googling it. Hint: pyenv

Re: Python 3.11

#27
post #21
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

i sympathize. the problem is apple. they are (understandably) refusing to ship an up-to-date global python interpreter with macOS. not only that, they aren't removing the default 2.7 that they ship. macOS Big Sur ships Python 2.7. ha. ha. ha. none of the proposed "virtual environments" solutions are going to rescue you when you operate globally at the OS-level and not in a sandbox. been there.

> they are (understandably) refusing to ship an up-to-date global python interpreter with macOS

What is the understandable reasoning?

Re: Python 3.11

#28
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

Python dependency management is rubbish, and many python projects have incomplete or missing requirements.txt files. I dislike Python as well (why on earth is whitespace relevant??) but unfortunately if you want to tinker with any of the newest deep-learning projects, you'll need python. I use Anaconda for package management on Ubuntu, which helps a lot, but it's still not my preferred programming language.

> why on earth is whitespace relevant??

To eliminate the need for braces and semicolons, of course. It's part of what makes python so easy to read and write. Is it really such a problem?

I honestly can't imagine disliking python. It's my goto for anything where performance doesn't matter due to its unmatched ergonomics and vast libs. Golang comes close but for some reason having to implement really common and basic things yourself is part of the language's design philosophy. Plus it's compiled so you can't just drop into the interpreter for a slick one-liner.

What's your preferred quick and dirty scripting/programming langage?

Re: Python 3.11

#29
post #6

just spent about 4 hrs getting Python 2 and pip setup on my Mac. Any time I have the misfortune of needing to use python I get cold sweats at the thought of the environment stuff. Why is this still such a massive problem?

1. Python has a low barrier to entry and is a popular first language, so most users don't realise how bad it is.

2. Python was originally popular with old-school sysadmins, Debian types, and a lot of its package management is based around that philosophy of carefully hand-tended servers shared by multiple users.

Post reply on HN