Live data from Hacker News

Python 3.12.0 is to remove long-deprecated items

discuss.python.org

51–60 of 257 posts

Re: Python 3.12.0 is to remove long-deprecated items

#51
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)?

I do not know what is wrong with Python, because I use it only occasionally, for short programs that do not use obscure features. Nevertheless, there is no doubt that it is the worst software project that I have ever seen, during several decades, from the point of view of keeping compatibility between versions. For other programs, I may happen to need to have installed 2 versions, or maybe 3 versions, at most, in ord…

I will say this, I love python, and I hate python the way only someone who loves it can. I think everything you said is accurate.

I love writing Python code. I love its standard library and many third party libraries. But I loathe Python’s dependency management, and Python version upgrades are sometimes a huge pain. There are tools to help with this (pyenv or I am fond of asdf for python versions; poetry or pipenv for isolating package dependencies), but they only partially solve the problems and introduce new ones.

Re: Python 3.12.0 is to remove long-deprecated items

#52
post #48
post #8

Earlier quoted context omitted.

> Removed many old deprecated unittest features ... > You can use https://github.com/isidentical/teyit to automatically modernise your unit tests. I tried out teyit when it was a "Show HN" 10 months ago (at https://news.ycombinator.com/item?id=29948813 ). It not only pointed out places where I was using a deprecated alias, but also fixed a few places where I was using the API poorly (using "assertTrue(a binop b)" ins…

I can't comment on the quality of the tool, I just don't like this attitude of "just use this tool we don't support, hosted on some platform we don't control, which might disappear tomorrow". Back in the day, this tool would have been shipped (and supported) with stdlib, or at least be frozen somewhere "official".

That tool is not a permanent addition to the list of dependencies, but for a single migration effort. As such, it is unnecessary to include it in the standard library.

Re: Python 3.12.0 is to remove long-deprecated items

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

Not really windows, WSL. There's windows fork recommended. Classic python splitting the ecosystem up. Why something like this isn't in go or rust that's actually cross platform capable just seems like excess effort.

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.

Re: Python 3.12.0 is to remove long-deprecated items

#55
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.

Merriam Webster lists the following relevant meanings for "deprecated":

> to express disapproval of

> to withdraw official support for or discourage the use of (something, such as a software product) in favor of a newer or better alternative

In other words, deprecated is a strong signal that one should strive to migrate from items marked as such.

Re: Python 3.12.0 is to remove long-deprecated items

#56
post #38

Is there a standard way a Python script can ask for an older version of the environment? If I could insert a few lines of code into the top of the WikidPad source, to specify an OLDER version of wxPython, for example... I'd be able to switch to Linux from Windows. As it is now, there were breaking changes in wxPython (likely due to the culture of breaking working code extant in Python) which result in WikidPad being…

Sure, just put something like `wxPython https://pip.pypa.io/en/stable/reference/requirements-file-fo...

As near as I can tell, the repository [1] doesn't have a requirements.txt

[1] https://github.com/WikidPad/WikidPad

Re: Python 3.12.0 is to remove long-deprecated items

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

as of late I've settled on using asdf[0] rather than nvm, pyvenv etc.

[0] https://asdf-vm.com/guide/getting-started.html

Re: Python 3.12.0 is to remove long-deprecated items

#58

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…

> other programming language whose maintainers don't break the "user space"

I think Go qualifies here. (but it's still much younger than Python).

Re: Python 3.12.0 is to remove long-deprecated items

#59
post #14

Earlier quoted context omitted.

There's quite a bit more than just the unittest removals https://docs.python.org/dev/whatsnew/3.12.html#removed An example of a more recent deprecation is the 'distutils' module which was deprecated in 3.10.

> An example of a more recent deprecation is the 'distutils' module which was deprecated in 3.10. distutils was functionally deprecated long before that. Even the Python 2.7 documentation (released in 2010!) recommended that users avoid distutils and use setuptools instead: https://docs.python.org/2.7/library/distutils.html

Isn't setuptools deprecated now too or on the chopping block?

Re: Python 3.12.0 is to remove long-deprecated items

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

Is there a problem with venv? I am seriously curious. I use venv for 10 years and so far it was able to do everything I ever wanted.
Post reply on HN