News for hackers. Stuff that matters.
Re:Python 3.12 by diarrhea on Monday October 02, 2023 @10:58AM (#37738982)
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 by mrweasel on Monday October 02, 2023 @12:46PM (#37740786)
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.
Re:Python 3.12 by MrBuddyCasino on Monday October 02, 2023 @03:37PM (#37743323)
Relieved to learn its not just the Java libs that are piles of hastily cobbled-together crap.
Re:Python 3.12 by vorticalbox on Monday October 02, 2023 @04:04PM (#37743700)
Python has enums though :(
Re:Python 3.12 by mrweasel on Tuesday October 03, 2023 @02:38AM (#37748606)
Sure, but Microsoft doesn't always use them.
Re:Python 3.12 by gen220 on Monday October 02, 2023 @03:38PM (#37743349)
`kwargs.pop`, what a phrase – it's amazing how the right arrangement of syllables can make your brain shudder. (:
Re:Python 3.12 by b33j0r on Monday October 02, 2023 @03:56PM (#37743611)
Well, who hasn’t used that classic datastructure `dictstack` (and famously the dict.pop operation)?

At first I was kinda giggling. But actually there are such things, if the Mapping is also ordered.

LRU cache, trees, tries… and—oh wait—all CPython dicts are ordered these days!

(Honestly I have only used the modern ordered-nature of `dict` for serialization to versioned or human-editable files. But why not an algorithm with a “`stackdict`” I guess?)