Comment by davesque
3 years ago
I didn't see the need to frame everything in the article as being so bad. I thought all those examples were awesome. I'll probably never do anything like them so as not to confuse people but I still think they were all interesting uses of the feature.
Honestly, I think people are too hard on languages (and especially Python) for having new features that challenge the status quo. And then there's also too much drama when it turns out that a scripting language is, in fact, a scripting language! So you can do weird things with stateful ABCs and such. I mean yeah, it's strange. But it probably also has some perfect use case in a very specific circumstance. At the end of the day, if you understand how a feature really works, you can do creative things with it. I'm glad we have it!
It made me want to learn python.
I've been thinking about programming language development, and some weird things from the typing front.
This could be easily used to achieve unions.
But another thing that I was thinking about was the return from unsafe land.
You have some class or object that you want to do some quasi-illegal fucky bullshit to - send it off and do what you will.
But what comes back might not have the guarantee that it's still the 'shape' of the thing that you sent away.
This could be used to validate that what comes back is sane.
>I thought all those examples were awesome.
They are great examples. Great examples of what not to do.
The only use case I can think of is meta programming which most people don't need.