Live data from Hacker News

Python 3.12

python.org

261–270 of 344 posts

Re: Python 3.12

#261

Earlier quoted context omitted.

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.

The Azure SDK generally have a lot of silliness in the Python implementation. Functions that take string as inputs, except of course they don't, they take two or three very specific string values and use them to control functionality. What those values are... Well, you should take a look at the ENUM in the C# implementation to figure that part out.

Python has enums though :(

Re: Python 3.12

#262

They keep getting improved error messaging and this is one of my favorite features. But I'd love if we could get some real rich text. Idk if anyone else uses rich, but it has infected all my programs now. Not just to print with colors, but because it makes debugging so much easier. Not just print(f"{var=}") but the handler[0,1]. Color is so important to these types of things and so is formatting. Plus, the progress b…

I love and use rich too, but gosh I hope that libraries don't start depending on it just because pip does.

It has a lot of dependencies of its own, and dependency creep is real. I know pytorch isn't exactly lightweight in terms of dependencies. But I prefer using libraries that make an effort do only pull in absolutely necessary dependencies.

Re: Python 3.12

#263

I'm just happy for itertools.batched for chunking iterables: https://docs.python.org/3.12/library/itertools.html#itertool...

yeah! that's been in the ruby stdlib practically from day one, no idea why python was so resistant to it.

Re: Python 3.12

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

If you didn't use **kwargs you'd have to copy and paste every kwarg and its default value from the superclass into the subclass, which is ridiculous IMO.

Re: Python 3.12

#266
post #5

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

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

The point was to read it both ways, so someone can score a political point on open borders policy.

Needless and pointless on release notes page of a programming language.

Re: Python 3.12

#267
post #48

Earlier quoted context omitted.

I don't think this is a political advocacy. It's just a personal expression about a social issue. I found the way it was written quite thoughtful, actually, which I respect (though I don't like in its entirety). But I upvoted your comment because I don't think there's a reason for people to downvote your comment. It's absolutely acceptable that someone dislikes the poem and wants to express it here. People confuse th…

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

I don't know if that's what you're implying, but I didn't suggest voting for agreement or even that I upvoted because I agree.

My comment starts with a disagreement, actually.

I said I upvoted because I think it's a fair expression that does not deserve to be buried. Downvotes can bury someone else's comment.

Re: Python 3.12

#268
What is the rationale for types being part of the syntax but without shipping a built in type checker? Are we being conservative and waiting to see where the four type checkers — mypy, pyrite, pyre, pytype, and others? — lead us before rolling one into the standard distribution?

Re: Python 3.12

#269

Earlier quoted context omitted.

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!

These days you want java then! Why are you not using java?

Re: Python 3.12

#270
post #16
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.

Too bad there's no Python API available yet :( It's scheduled to be delivered next year if I'm not mistaken. The new syntax for generic types is also a very nice QOL improvement, you can now just do: class MyList[T]: ...

I think you are talking about the "stable Python ABI"?
Post reply on HN