Live data from Hacker News

Python 3.12

python.org

231–240 of 344 posts

Re: Python 3.12

#231
post #186

Earlier quoted context omitted.

> Either copy/paste or rolling them into config objects and passing those down is generally preferable Preferable for whom? I do not prefer it. I much prefer to avoid the extra work it creates for me vs. the simplicity of kwargs. I use explicit args for the function I made and then add *kwargs on the end and then I don't have to write bespoke config objects or copy and paste a bunch of stuff that might be obsolete by…

Preferable for those who would use your code. If it’s just you then it’s your exclusive preference. If you have users, args/kwargs is going to be more opaque than a more explicit option. For code with many users, creating a few extra minutes of work for one dev is preferable when the alternative would be every dev who uses that code has to spend that same extra work and then some to grok what exactly is going on with…

I think people kind of miss the idea of kwargs in python, the idea is that they are a dict. You can cast a dict to kwargs, in contrast to positional args. I see the typedict being super useful. I really don’t see your argument and would say that this typed dict is more developer friendly than having positional arguments. https://docs.python.org/3/tutorial/controlflow.html#more-on-...

Re: Python 3.12

#232
post #74

Ooh, seems there is a new syntax for declaring the types of kwargs [1]: from typing import TypedDict, Unpack class Movie(TypedDict): name: str year: int def foo(*kwargs: Unpack[Movie]): ... Maybe now I'll be able to actually figure out what data to send libraries without actually reading their source code. 1. https://docs.python.org/3.12/whatsnew/3.12.html#pep-692-usin...

Finally! I've been waiting for this for years. Now I just have to wait 5 more years until 3.12 is sufficiently old that work lets me use it. Bets on user-upgradable Python on Linux by 2030?

On Ubuntu at least you can install versions of Python separate from the system one.

https://www.cherryservers.com/blog/install-python-on-ubuntu

Re: Python 3.12

#233
post #74

Ooh, seems there is a new syntax for declaring the types of kwargs [1]: from typing import TypedDict, Unpack class Movie(TypedDict): name: str year: int def foo(*kwargs: Unpack[Movie]): ... Maybe now I'll be able to actually figure out what data to send libraries without actually reading their source code. 1. https://docs.python.org/3.12/whatsnew/3.12.html#pep-692-usin...

Unfortunately the typed kwargs are NOT composable :(.

Re: Python 3.12

#234

Earlier quoted context omitted.

I'm not sure how to interpret these lines in a way that doesn't suggest support for unchecked immigration: > Do not be so stupid to think that > A place should only belong to those who are born there >... > It is not okay to say > Build a wall to keep them out

I'm guessing you're not an American by this comment, at least from the US >Do not be so stupid to think that >A place should only belong to those who are born there Does not imply unchecked migration since the entire social fabric of the United States is a based upon people moving here from somewhere else. Currently around 14% of US citizens are foreign born. Claiming they don't belong here would be considered an ext…

People born here do not have an automatic right to US citizenship. The 14th Amendment was intended for the descendants of slaves. It was not intended to cover the child of a diplomat born in the USA. Nor was it similarly intended for people who entered the country illegally. In time we will review cases of so-called birthright citizenship for those who are children of people who entered illegally, and correct the status. As noted, foreign diplomats children born here, do not have US citizenship for a reason.

Re: Python 3.12

#235

What's with the politicising at the end? I agree that both the EU (from where I'm from) and the US have chosen to take a very dark and authoritarian view on immigration, but I think that that discussion doesn't belong in a Python release announcement.

It's a US cultural thing

Re: Python 3.12

#236
post #208

Earlier quoted context omitted.

Software is always user-upgradable on Linux. Just install it somewhere in your home directory. GNU Stow [0] can be helpful as a very lightweight way to manage the packages. (Of course, then you take on the responsibility of keeping up with patch releases yourself, which is why we use distros. But if it's just a small number of packages on top of a distro-managed base system, it's perhaps not so bad.) [0] https://www.…

Sure and how do you install Python 3.12 on RHEL 8 without compiling it from source?

I don't know, but what is the problem with compiling from source ? Some softwares are hard to compile but I found Python really easy to compile.

Re: Python 3.12

#239
post #208

Earlier quoted context omitted.

Software is always user-upgradable on Linux. Just install it somewhere in your home directory. GNU Stow [0] can be helpful as a very lightweight way to manage the packages. (Of course, then you take on the responsibility of keeping up with patch releases yourself, which is why we use distros. But if it's just a small number of packages on top of a distro-managed base system, it's perhaps not so bad.) [0] https://www.…

Sure and how do you install Python 3.12 on RHEL 8 without compiling it from source?

Just run the miniforge install script if you want a very friction-free install. I'm not a big conda fan, but the "install in my home directory" use case is very well covered by miniforge. https://github.com/conda-forge/miniforge/

Re: Python 3.12

#240
post #74

Ooh, seems there is a new syntax for declaring the types of kwargs [1]: from typing import TypedDict, Unpack class Movie(TypedDict): name: str year: int def foo(*kwargs: Unpack[Movie]): ... Maybe now I'll be able to actually figure out what data to send libraries without actually reading their source code. 1. https://docs.python.org/3.12/whatsnew/3.12.html#pep-692-usin...

Finally! I've been waiting for this for years. Now I just have to wait 5 more years until 3.12 is sufficiently old that work lets me use it. Bets on user-upgradable Python on Linux by 2030?

Using containers is a reasonable workaround:

https://realpython.com/python-versions-docker/#running-pytho...

Post reply on HN