Live data from Hacker News

Python 3.12.0 is to remove long-deprecated items

discuss.python.org

91–100 of 257 posts

Re: Python 3.12.0 is to remove long-deprecated items

#91
post #3

Earlier quoted context omitted.

The title is referencing this line (not TFA's actual title): > In the unittest module, a number of long deprecated methods and classes were removed. (They had been deprecated since Python 3.1 or 3.2). I doubt your projects are using 3.1 or 3.2 (or older, except perhaps 2.7, but then you wouldn't care that 3.12 was removing something deprecated vs 3.11 which has it)?

Deprecated does not mean removed. They are still there, working fine, having no big reason to change them. I know it, as I just checked my and my workplaces code, and there are several usages of deprecated code. And we are on 3.9/3.10.

Except the notice is about "removing deprecated modules"? Deprecation usually means "These are going away at some point. Be aware.".

Re: Python 3.12.0 is to remove long-deprecated items

#92
> smtpd has been removed according to the schedule in PEP 594

Damn! I guess it's time to cross out my snippet of running a debug smtp server in almost any Linux distro & Mac:

python -m smtpd -n -c DebuggingServer localhost:25

> Remove the distutils package. It was deprecated in Python 3.10 by PEP 632

So apparently we need to replace

from distutils.version import StrictVersion

with

from pkg_resources import parse_version

A bit labor for my code but OK.

Re: Python 3.12.0 is to remove long-deprecated items

#93
post #78

Earlier quoted context omitted.

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?

Nix has every maintained python version, so does Arch User Repository, and those can definitely be in parallel.

Re: Python 3.12.0 is to remove long-deprecated items

#94
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

There is a fork: https://github.com/pyenv-win/pyenv-win

Re: Python 3.12.0 is to remove long-deprecated items

#96
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

There is a windows port that works great! https://pyenv-win.github.io/pyenv-win/

Re: Python 3.12.0 is to remove long-deprecated items

#97

Speaking of standard lib, today I was looking to do a sliding window over an iterator and ended up on the pairwise function in itertools that was added in 3.10. Seems like such a wasted opportunity, to add a sliding window for n=2, and then in the documentation add a recipe for a sliding window function for any n.

There are a lot of things like this in the boltons library: https://boltons.readthedocs.io/en/latest/iterutils.html#bolt...

It's nice to not have to depend on anything external, but boltons is something I just treat as an expanded part of the standard library.

Re: Python 3.12.0 is to remove long-deprecated items

#98
post #88
post #10

While it's been coming for a long time, it's still frustrating to see the cgi module go. It's going to create a load of busy work to rewrite some low-traffic scripts. Modules being removed [edit: in 3.13]: https://docs.python.org/dev/whatsnew/3.12.html#pending-remov... Updating CGI scripts will be a bit fiddly: https://peps.python.org/pep-0594/#cgi

Just copy out cgi.py and use it as a module. https://github.com/python/cpython/blob/3.11/Lib/cgi.py

It's even vendored!

Re: Python 3.12.0 is to remove long-deprecated items

#99
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

How does pyenv compare with conda, mamba, pip and poetry? I typically use conda but ever since they broke with python 3.10 I have been considering moving to other environment managers.

According to StackOverflow the conda 3.10 bug was fixed this January. https://stackoverflow.com/a/70614013/733092

Re: Python 3.12.0 is to remove long-deprecated items

#100
post #89

wait, since when python.org has a discuss subdomain? And it's running Discourse which is built on RoR? What the...

Not sure how the Not Invented Here syndrome would help in this case.

Besides, a few years ago they moved from Mercurial to Git(Hub).

Post reply on HN