Live data from Hacker News

Python 3.12

python.org

121–130 of 344 posts

Re: Python 3.12

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

> Maybe now I'll be able to actually figure out what data to send libraries without actually reading their source code. One could hope, but any library abusing kwargs in all their methods is showing they’re willing to go through the absolute minimum to make their code usable, let alone readable and self-documenting.

It’s like pointer chasing, except the docs having you chase around kwargs are incomplete and there’s gaps. You have to read source code.

The Azure SDK is full of them, making liberal use of kwargs.pop. What a nightmare.

Re: Python 3.12

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

Re: Python 3.12

#123
post #97

Earlier quoted context omitted.

I like how you get to read it in the direction you most agree with. Very politically balanced!

It’s actually the opposite of balanced; it’s polarized .

Polarised, but still balanced due to the symmetric nature of the poem's structure!

Re: Python 3.12

#124
post #5

Everything aside, I enjoyed the "And now for something completely different" part.

A place should belong to whoever wills to take good care of it. We're all just passengers on the starship Earth.

Even Python is no longer the same language that I learned almost 20 years ago, but I'm happy of what its current stewards have made of it.

Re: Python 3.12

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

some add what it takes in the DOC string, but even then most don't actually state all the options.

Yep, it’s incomplete, and much more importantly not machine readable. These days I want all my code to pass strict mypy. It’s mostly possible and a bliss when it works, but libraries (ab)using kwargs throw a spanner in that. Libraries where everything is kwarg and the docs have to be consulted are a killjoy. And they cause tons of bug from misuse!

Re: Python 3.12

#128
post #4

I think the support for isolated sub-interpreters with separate Global Interpreter Locks is the most interesting new feature in python. It is doubtful not the best way to offer some sort of concurrency but still a step closer to maybe one day get rid of GILs.

It may not be a step towards that. Ruby has guilds which is a very similar idea and they are explicitly not working towards removing them altogether at this point. Matz did a full keynote on the latest Euruku defending not working towards removing the whole of it. See https://www.youtube.com/watch?v=5WmhTMcnO7U&t=1244s for the full talk if you are interested.

I find the convergent evolution of features in these two languages pretty funny, as it is very clear that they don't really look at implementation details of the other language even if they quite often land on ideas that are pretty close in practice.

Re: Python 3.12

#129

Earlier quoted context omitted.

If an upvote is for agreement, does downvoting for disagreement not make sense? Or are upvotes meant for something else?

from the guidelines: Users should vote and comment when they run across something they personally find interesting Also: Please don't comment about the voting on comments. It never does any good, and it makes boring reading. Well... sorry then :-) And final: Please don't use Hacker News for political or ideological battle. That tramples curiosity.

> It never does any good

I do feel like it can help to break the herd mentality thing of "if it's already downvoted, downvote it more" by making people think about why they've done it

Re: Python 3.12

#130
post #54
post #12

> PEP 684, a unique per-interpreter GIL We are on the track to remove GIL!

This change is completely separate from nogil, not it’s first step.

Yeah, it is essentially the same idea as the guild thing in Ruby, and Ruby is explicitly not working towards nogvl.
Post reply on HN