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 3.12
261–270 of 344 posts
Re: Python 3.12
#262They 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…
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
#263I'm just happy for itertools.batched for chunking iterables: https://docs.python.org/3.12/library/itertools.html#itertool...
Re: Python 3.12
#264Ooh, 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.
Re: Python 3.12
#265Everything aside, I enjoyed the "And now for something completely different" part.
It's better to stick to programming. Leave politics to politicians.
Re: Python 3.12
#266Everything 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!
Needless and pointless on release notes page of a programming language.
Re: Python 3.12
#267Earlier 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?
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
#268Re: Python 3.12
#269Earlier 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!
Re: Python 3.12
#270I 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]: ...