Hacker News new | ask | show | jobs
by diarrhea 993 days ago
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.

2 comments

`kwargs.pop`, what a phrase – it's amazing how the right arrangement of syllables can make your brain shudder. (:
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?)

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.
Relieved to learn its not just the Java libs that are piles of hastily cobbled-together crap.
Python has enums though :(
Sure, but Microsoft doesn't always use them.