Yes, this only prevents the callee from mutating it, it can't provide a strong guarantee that the underlying mapping won't be changed upstream (and hence MappingProxyType can't be washable).
I remember reading somewhere in a different HN thread that some tools use pitch to represent indentation depth. There are all sorts of audio cues that can be used to represent syntactic information about code.
That's really interesting. I wonder what other audio cues can be used other than the simple content of the words.
Voice, maybe? Humans are great at distinguishing lots of different voices. Are there any screen reader tools that use a mixture of different people's voices to add additional fidelity to the information?
Yes, some screen readers such as JAWS can be configured to use a different voice to represent bold text, for example. They can also use non-speech sounds to represent things such as HTML elements.
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.
My understanding is that most people perceive relative pitch in music (is this note higher or lower than the other notes around it) but not absolute pitch. I'd expect people to have to no trouble teasing out the indentation of a stretch of code, but if you hear just a few words out of context (which you do a lot with a screen reader... I'm not blind but I've been tasked with making sites accessible and spent a lot of time w/ NVDA) you will probably lose the thread.
I think ctypes shines when it comes to fast prototyping, since you can iterate on the python bindings without a compilation step. It can also simplify distribution since the bindings can be pure python. Where it's arguably not so good is performance and maintainability.
Dicts already have confusing half-ordered, half-not semantics. As of 3.7 they are guaranteed to be insertion-ordered, but operators like == don't care about order.
I don't think it's confusing or even on the level of "semantics": looping over dict keys/elements is a common pattern and the 3.7 change makes that a little more predictable and consistent.
Two dicts with same elements not being equal would be surprising and confusing.
If we're treating them as ordered containers then it really ought to be surprising and confusing that two dicts with the same elements in a different order are considered equal. Other ordered containers such as lists or tuples don't behave this way.
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.
Yes, but I hope nobody really relies on that ordering in their code, as, as you say, it is pretty inconsistent.
Eg. you can't rely on
dict_b_keys = iter(dict_b)
for key in dict_a:
value_a = dict_a[key]
value_b = dict_b[next(dict_b_keys)]
print(f"{value_a} == {value_b}: ", value_a == value_b)
The problem with the proposal is that it will be even stronger: you either require '*' to sort in-place (I assumed that would be even worse and thus unacceptable, so I ignored that case — it seems others believe that to be a more realistic implementation), or require dicts to maintain a half-sorted map of integer keys.
I don't think it's that simple. No one acts 100% rationally all of the time. In this respect, addicts, children, and the mentally unwell differ from the rest of us by degree - they may have diminished responsibility for their own actions, but I don't think it makes sense to try to draw a sharp line where you're either responsible for your own actions or you're not. Recovery from addiction requires assuming responsibility for one's actions.
And they are dancing, the board floor slamming under the jackboots and the fiddlers grinning hideously over their canted pieces. Towering over them all is the judge and he is naked dancing, his small feet lively and quick and now in doubletime and bowing to the ladies, huge and pale and hairless, like an enormous infant. He never sleeps, he says. He says he’ll never die. He bows to the fiddlers and sashays backwards and throws back his head and laughs deep in his throat and he is a great favorite, the judge. He wafts his hat and the lunar dome of his skull passes palely under the lamps and he swings about and takes possession of one of the fiddles and he pirouettes and makes a pass, two passes, dancing and fiddling at once. His feet are light and nimble. He never sleeps. He says that he will never die. He dances in light and in shadow and he is a great favorite. He never sleeps, the judge. He is dancing, dancing. He says that he will never die.
I think there's a beauty in the bleakness. Some of the descriptions are just so vivid, like a charcoal sketch.
> 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.
reply