Live data from Hacker News

Python 3.12.0 is to remove long-deprecated items

discuss.python.org

71–80 of 257 posts

Re: Python 3.12.0 is to remove long-deprecated items

#71

Sad to see distutils going away. I have very old projects which use distutils for distribution. Wrote them in Python 2 days and they were ported easily to Python 3. But distutils going away is going to break them. I know setuptools is advanced and recommended but distutils worked fine for me and my users for so many years. It is going to be overhead for me to comb through all my projects and replace distutils with se…

A warning that while there's something called sysconfig that replaces distutils.sysconfig, it is not compatible:

https://github.com/libguestfs/libguestfs/commit/26940f64a740...

Re: Python 3.12.0 is to remove long-deprecated items

#72
post #26

Don't think I was using any of these removed things, and it all sounds sensible looking at the fuller list at https://docs.python.org/dev/whatsnew/3.12.html#removed > Remove the filename attribute of gzip.GzipFile, deprecated since Python 2.6, use the name attribute instead. 2.6 wow, that's some compatibility right there. About time that got removed then! Either that or undeprecate it, if it's fine to use. Any decisi…

Perhaps after the big mess of the backwards incompatibilty of 3.x vs 2.x, they are erring on the side of caution now.

Re: Python 3.12.0 is to remove long-deprecated items

#73
post #27

This is a reminder that the excellent pyenv [0] project can help you manage all your Python versions. - Set global and per-project python versions - Not written in Python. - Shims your PATH - Linux, Mac, Windows [0]: https://github.com/pyenv/pyenv

> Pyenv does not officially support Windows and does not work in Windows outside the Windows Subsystem for Linux.

I don't only use Win but I do use windows, so having to use different tooling makes pyenv a hard to swallow pill

Re: Python 3.12.0 is to remove long-deprecated items

#74

Earlier quoted context omitted.

You say that, but the web platform rarely if ever removes features in this way. My web code from 15 years ago works the same as it always did.

Obviously you chose the wrong framework or even worse - none at all. Ye I am whining but only half joking. Breaking backwards compatibility ruins my mood. And Python are getting way to much slack for what they have been doing to the users. People wanting to stick to 2.7 are ridiculed and soon the software security police will start arresting offenders.

I recently upgraded a Python 2 + Django 1.x project with no tests to Python 3 and latest Django.

Using 2to3, the most trouble I had were db migrations, which I just squashed. The rest were ferreting out str() problems that 2to3 didn't find (eg. redis package happily taking strings but returning bytes by default), Django regexp url changes, and trivial stuff like that.

It took a couple of days work.

I also wanted to upgrade the frontend part (webpack build of Vue). I stopped after a few hours od going nowhere and am still apprehensive of approaching that particular thing.

Re: Python 3.12.0 is to remove long-deprecated items

#75
post #27

This is a reminder that the excellent pyenv [0] project can help you manage all your Python versions. - Set global and per-project python versions - Not written in Python. - Shims your PATH - Linux, Mac, Windows [0]: https://github.com/pyenv/pyenv

`python3.10 -m venv` or `python3.11 -m venv` the default approach works fine and I don't need pip anything to get a virtualenv, what's the selling point of pyenv?

Re: Python 3.12.0 is to remove long-deprecated items

#77
I see telnetlib is on the way out in 3.13 or so, which means a lot of pointless busywork in my future. Its a super useful module for a lot of tasks.

The suggested replacements either are asyncio based (which means whole ass rewrites as asyncio is really fucking opinionated), or are excessively restrictive in some stupid way.

"Infosec" at work tend to raise a ruckus when their scans detect "older" versions of Python on machines too, so virtualenv'ing to pin versions or similar is often not the most practical in prod without getting an exception.

Re: Python 3.12.0 is to remove long-deprecated items

#78
post #27

This is a reminder that the excellent pyenv [0] project can help you manage all your Python versions. - Set global and per-project python versions - Not written in Python. - Shims your PATH - Linux, Mac, Windows [0]: https://github.com/pyenv/pyenv

`python3.10 -m venv` or `python3.11 -m venv` the default approach works fine and I don't need pip anything to get a virtualenv, what's the selling point of pyenv?

In your example, how did you install python 3.10 and 3.11? That's part of what pyenv solves for you.

Re: Python 3.12.0 is to remove long-deprecated items

#79
post #53

Earlier quoted context omitted.

Because thanks to WSL the lingua franca of scripting languages is bash and that’s how pyenv started. Rewriting when it works fine on Windows and every dev I know uses WSL anyway is excess effort. Hell, the fork could have used Go or whatever too but it went with a bunch of .bat scripts.

Hello from corporate America where WSL is most certainly not standard and will require a virgin sacrifice if you want to get it approved by IT. Which is to say, no pyenv is not an option for everyone.

Indeed, I recently worked on a fairly simple deployment for a state government agency. When I described the process to their IT staff and mentioned that we prefer using WSL, they looked at me like I had grown 2 heads.

Re: Python 3.12.0 is to remove long-deprecated items

#80
post #78

Earlier quoted context omitted.

`python3.10 -m venv` or `python3.11 -m venv` the default approach works fine and I don't need pip anything to get a virtualenv, what's the selling point of pyenv?

In your example, how did you install python 3.10 and 3.11? That's part of what pyenv solves for you.

Dont't most linux distros have separate packages for most recent python major versions, so that they can't installed in parallel?
Post reply on HN