dabeaz / curio

Good Curio!
Other
4.01k stars 240 forks source link

Using meta module... will I die? #288

Closed kdart closed 4 years ago

kdart commented 5 years ago

There's some good stuff in the meta module. Especially the awaitable decorator was something that I was wanting. But, I'm worried I might die. What are the odds of it being stable enough that I won't die? :-)

dabeaz commented 5 years ago

I think the real challenge is getting Python core devs to think that any of this is sane--especially the _from_coroutine() function. That's the magic bit that underlies the awaitable decorator and many other features in the meta module. I'd love to see something like that more formally put in the sys module.

Personally, I think it's super-cool to be able to make things like Curio's UniversalQueue object where there's just a single API that "works" regardless of sync/async. It opens up all sorts of interesting usage patterns and even a kind of "duck concurrency" where you can just write code that works with threads or curio and it doesn't matter too much. I'm sure some are offended by such ideas, but those people are no fun. Bah. Good riddance!

As for stability, the code is somewhat sensitive to the structure of code objects and bytecode. If the flags on code objects were to change or some other drastic change were made, I could see it breaking. It hasn't broken yet though ;-).