Live data from Hacker News

Python 3.12

python.org

31–40 of 344 posts

Re: Python 3.12

#31

Thank god for type aliases

I am excited for the typeddict additions, but it looks like there’s still some work around unpacking needed before we can use it to get around using kwargs to forward arguments from one function to another without having to know the other’s signature.

Re: Python 3.12

#32

What's new: https://docs.python.org/dev/whatsnew/3.12.html Summary, sorry for poor formatting, I'm not sure HN can do a list of any kind? New features More flexible f-string parsing, allowing many things previously disallowed (PEP 701). Support for the buffer protocol in Python code (PEP 688). A new debugging/profiling API (PEP 669). Support for isolated subinterpreters with separate Global Interpreter Locks (PEP 684…

What are the advantage of Cython over something like C++ with pybind11 or whatever the equivalent in Rustland?

Cython is similar to python and is fairly easy to write for a python user, while C++ or Rust have much larger learning curves.

Re: Python 3.12

#33

oh cool, multi-line f-strings. With inline comments! f"This is the playlist: {", ".join([ 'Take me back to Eden', # My, my, those eyes like fire 'Alkaline', # Not acid nor alkaline 'Ascensionism' # Take to the broken skies at last ])}"

Some great choices in that playlist ;)

Re: Python 3.12

#34

Holy shit, actual multithreading. Never thought I'd see the day, good on the Python team for making such great improvements.

Ergonomic multi-core multithreading is already solved, for me at least, with ProcessPoolExecutor.map(). I wonder what advantages this direction brings to the table.

Re: Python 3.12

#35

As now f-strings can contain any valid Python expression inside expression components, it is now possible to nest f-strings arbitrarily: >>> f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}" '2' Is anyone aware of the change to the interpreter that allows for this?

just replace `f"{` -> `(` and `}"` -> `)` and it's conventional expression eval.

Re: Python 3.12

#36
post #27

As now f-strings can contain any valid Python expression inside expression components, it is now possible to nest f-strings arbitrarily: >>> f"{f"{f"{f"{f"{f"{1+1}"}"}"}"}"}" '2' Is anyone aware of the change to the interpreter that allows for this?

Parse it recursively.

yup

Re: Python 3.12

#37
post #21

Earlier quoted context omitted.

I don't think political advocacy belongs in an announcement of a Python version.

I despise random politics injections as well, but this is rather tame and very much in line with the ironic spirit of how Python release notes are written. I don't think it's offensive to anybody who doesn't go out of their way to become offended by things.

Would you feel the same way if it were a cutesy poem supporting an opposing view?

Re: Python 3.12

#38

Holy shit, actual multithreading. Never thought I'd see the day, good on the Python team for making such great improvements.

Steady now ...

The features of Per-Interpreter GIL are - for now - only available using C-API, so there's no direct interface for Python developers. Such interface is expected to come with PEP 554, which - if accepted - is supposed to land in Python 3.13, until then we will have to hack our way to the sub-interpreter implementation.

https://martinheinz.dev/blog/97

Re: Python 3.12

#39
post #5

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

I don't think political advocacy belongs in an announcement of a Python version.

For people who downvote Bostonian for his comment, how would you like it if that announcement, say, contained an abortion-related proclamation that you don't agree with?

"Share our food, Share our homes and Share our countries" is quite a big demand on everyone else. I am certainly not willing to do so without limit and without regard to context (e.g. the Muslim gang war that flared up in Sweden).

Re: Python 3.12

#40
The new `type` statement with lazy evaluation looks interesting.

Wonder if it could be used to add lazy evaluation to other libraries, like numpy?

Post reply on HN