71 karma · joined June 7, 2018
One of the things that really blew my mind is just how fast a proficient screen reader user can crank up the speed, e.g. https://soundcloud.com/freecodecamp/zersiaxs-screen-reader. It's totally unintelligible to me, and doesn't even sound much like human speech.
If you're no longer constrained by the speed and sound of normal speech all kinds of other interesting audio representations become possible.
I'd use an `OrderedDict` in situations where I have a mapping where the order of elements is significant. `OrderedDict` signals intent much more clearly, and its `__eq__` method cares about order.
> He came forward, holding his belt by one hand. The holes in it marked the progress of his emaciation and the leather at one side had a lacquered look to it where he was used to stropping the blade of his knife. He stepped down into the roadcut and he looked at the gun and he looked at the boy. Eyes collared in cups of grime and deeply sunk. Like an animal inside a skull looking out the eyeholes. He wore a beard that had been cut square across the bottom with shears and he had a tattoo of a bird on his neck done by someone with an illformed notion of their appearance. He was lean, wiry, rachitic. Dressed in a pair of filthy blue coveralls and a black billcap with the logo of some vanished enterprise embroidered across the front of it.
The line about how the "holes in [his belt] marked the progress of his emaciation" is seared into my brain forever.
Some of them would, but perhaps not a majority. When the Police Federation most recently surveyed their members on this question in 2017 [1], 66% were opposed to routinely arming officers with firearms (although that number is down from 82% in 2006).
[1] https://www.polfed.org/our-work/operational-policing/firearm...
That's not how `defaultdict` works - the key isn't passed to the default factory, so there's no opportunity for it to raise a `KeyError` if the key doesn't "logically belong" in the dict. It's possible to get that sort of behaviour by overriding `__missing__`, but I very rarely see this sort of thing in the wild.
A more typical use case is something like `defaultdict(list)` as a convenient way to build a dict of lists. This is fine within a limited scope where it's obvious to the reader that they are dealing with a defaultdict that has special `__getitem__` semantics, however it's a bad idea to return a defaultdict to a caller who might be expecting a normal dict, and would be surprised that missing keys don't result in KeyErrors.
With `.setdefault(key, default_value)` it's unambiguous what we're trying to achieve - the reader doesn't need to know whether they are dealing with a defaultdict.
I generally prefer to use .setdefault(key, default_value) with regular dicts, as it's much more explicit. If I do use a defaultdict for convenience, I will usually only use it within a limited scope, and if I'm returning it then I'll cast it back to a normal dict to avoid surprising the caller.
I get the impression that most of the people who are complaining in the comments here are really getting worked up about some inferred political bias, rather than because they actually disagree with the substance of the style guide.
I personally agree with ~95% of the list, and the other 5% seems too trivial to be worth arguing over. I couldn't care less about the motivation behind the rules (political or otherwise) as long as they don't sacrifice clarity, and I think that's basically true for everything in here.
> Ceph is a unified, distributed storage system designed for excellent performance, reliability and scalability.
although it's annoyingly hidden away in a carousel. Carousels - not even once.