You _can_ write pathological code like the Everything example, but I can see this feature being helpful if used responsibly.
It essentially allows the user to check if a class implements an interface, without explicitly inheriting ABC or Protocol. It’s up to the user to ensure the body of the case doesn’t reference any methods or attributes not guaranteed by the subclass hook, but that’s not necessarily bad, just less safe.
> It essentially allows the user to check if a class implements an interface, without explicitly inheriting ABC or Protocol.
Protocols don't need to be explicit superclasses for compile time checks, or for runtime checks if they opt-in with @runtime_checkable, but Protocols are also much newer than __subclass_hook__.
I don't think so. I think the other code should just stop using isinstance checks and switch to some custom function. I personally think isinstance checks benefit from having its behavior simpler and less dynamic.
> check if a class implements an interface, without explicitly inheriting ABC or Protocol
This really doesn't sound like a feature that belongs in the language. Go do something custom if you really want it.
But the moment you use a third party library, you cannot use it “responsibly” because that library, too, might use it “responsibly”, and then, you can easily get spooky interaction at a distance, with bugs that are hard or even impossible to fix.
Google also invested $2B into Anthrophic. Seems like both Google and Amazon are providing credits for their cloud, also as a hedge against Microsoft / OpenAI becoming too big.
If I have to chose between Amazon and Microsoft I’ll chose the lesser evil. Microsoft owns the entire stack from OS to server to language to source control. Anything to weaken their hold is a win in my book.
> chose between Amazon and Microsoft... the lesser evil
A hard question. If you focusing purely on tech, probably Microsoft. But overall evil in the world? With their union busting and abuse of workers, Amazon, I'd say.
Not necessarily in Rust itself. Actually I like R as a language. I was more thinking something along the lines of Typist. A modern take of a proven concept, possibly with a Rust inspired scripting language.
And it crowded out every historical playthrough video of the original Brood War on YouTube, such that full playthroughs of the original are impossible to find.
And so, through grasping at the straws of rehashing old stuff they can't make anew, they ruin the old stuff that was good. :D
That may depend on what you're trying to do. If you are figuring out something tricky, then lots of quiet head down time is what you need. Every interruption hurts when you are concentrating.
However, a lot of the time is just figuring out how to glue together multiple systems. Being able to pull in various people to interface little bits is priceless. There is no flow here, only collaboration.
In the same way I don’t expect a biologist writing for biologists to explain “DNA” stands for “deoxyribonucleic acid”, it’s probably not necessary for a music producer writing for producers and engineers to define “DAW”.
Users here probably feel the same way about HTML, FIFO, DAG, etc
They definitely did not fix housing prices. Demand and purchasing power are lower with the higher interest rates, but supply is abysmal for the reasons you mentioned.
It essentially allows the user to check if a class implements an interface, without explicitly inheriting ABC or Protocol. It’s up to the user to ensure the body of the case doesn’t reference any methods or attributes not guaranteed by the subclass hook, but that’s not necessarily bad, just less safe.
All things have a place and time.