Live data from Hacker News

Python 3.12.0 is to remove long-deprecated items

discuss.python.org

61–70 of 257 posts

Re: Python 3.12.0 is to remove long-deprecated items

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

> Set global and per-project python versions

Does that mean I can do things like install black and jupyter once and use that install across projects?

Re: Python 3.12.0 is to remove long-deprecated items

#63

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.

If people that want to stick to 2.7 can find a vendor that supplies them security patches, then there is no problem.

Re: Python 3.12.0 is to remove long-deprecated items

#64
post #53

Earlier quoted context omitted.

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.

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.

Re: Python 3.12.0 is to remove long-deprecated items

#65
post #36
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

A hidden gem of pyenv is its 'python-build' plugin, which just lets you build and install any Python version in the least number of steps: git clone https://github.com/pyenv/pyenv.git cd pyenv/plugins/python-build/bin ./python-build --definitions ./python-build 3.10.8 /opt/python/3.10.8 PYTHON_CONFIGURE_OPTS="--enable-shared" ./python-build 3.10.8 /opt/python/3.10.8

I’ve regularly used ‘python-build’ in docker container construction to build a minimal (or customised) self contained Python binary, libs tool chain, etc, in an isolated path to make copying to from the build container to the final artefact container. It’s just all around excellent tooling.

Re: Python 3.12.0 is to remove long-deprecated items

#66
post #38

Earlier quoted context omitted.

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

It's here in setup.py: https://github.com/WikidPad/WikidPad/blob/master/setup.py#L6...

Re: Python 3.12.0 is to remove long-deprecated items

#67
If we're going to be making backwards incompatible changes to unittest, it'd be nice to introduce PEP8-compatible names, deprecate the old ones, and remove then in 3.20 or something.

(I know there's pytest and nosetests, but especially when teaching people, it's nice to use what's in the standard library and unittest sticks out for having things named differently)

Re: Python 3.12.0 is to remove long-deprecated items

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

There's no problem with venv. Python is just a popular language and people have built a lot of tools.

Re: Python 3.12.0 is to remove long-deprecated items

#69
post #31

Earlier quoted context omitted.

You should sign up to maintain those ancient modules

Why do they need to be maintained? Just leave them as is.

Apart from requiring security fixes, they also sometimes block changes and newer features. At that point, the maintainers might have to choose between breaking the obsolete module or shelfing the feature/fix.

Deprecations are the way to indicate that support for the module will be eventually dropped. There is no reason to leave those modules there if they cannot be relied on.

Re: Python 3.12.0 is to remove long-deprecated items

#70
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".

If you really go "back in the day", this sort of tool wouldn't exist at all, and you would be expected to do it manually, because there were no easy ways to modify the syntax in a space- and comment-preserving way. ;)

That was developed for 2to3.

Huh. I did not know this - in lib2to3, the "asserts" fixer handles this sort of conversion, so you have the ability already .. so long as you don't use new Python 3.10+ syntax that lib2to3 doesn't handle. See https://docs.python.org/3.7/library/2to3.html#2to3fixer-asse... .

I wonder if serhiy-storchaka (who committed that What's New entry) knows about lib2to3's "asserts" fixer. And if that might be a relevant addition or change to the documentation.

Someone who cares about this might want to point it out.

Post reply on HN