PEP 828: Supporting 'yield from' in asynchronous generators

My points were:

  1. This random Python user over here has battled with asyncio generators for years, trying to make good use of them, and ended up with numerous nasty problems in production that were ultimately solved by avoiding using this language feature entirely. Yes, you can easily argue that that’s all my fault for just being bad at coding or something :person_shrugging:, but I do feel there’s also an argument that if a language feature is this hard to use correctly, maybe there’s some flaws with its design. I’m not posting this to have a random bash at Python or asyncio. I love Python and asyncio! I’m posting this because I felt maybe just maybe it would be valuable feedback, that you wouldn’t likely often receive. I didn’t really want to post it, tbh, because any way of putting it feels rude, but despite that, I felt raising it was still important to try and improve Python.
  2. Despite whether or not async generators are a good idea, having a yield from syntax with the specific behavior of “yield from a sync generator within an async generator” and a separate async yield from syntax with the specific behavior of “yield from an async generator within an async generator” feels like incredibly counterintuitive design, so even if I was super happy with async generators and used them all the time, and would want this syntax, I would still fully object to the proposal as written on this ground alone.
  3. There are, imo, much more important problems to solve within asyncio right now than this one. Adding yet more syntax that is specifically tailored to how asyncio works right now makes it harder to improve asyncio in more fundamental ways, if they would have to rip out that syntax again. Hence why I felt status quo was best.

Regarding the problems with auto-detecting sync vs async - yes, I’m aware that actually implementing such a thing would be impractical if not impossible with how Python asyncio currently works. That’s why I said hypothetically. I was pointing out that from the user’s POV, the best, and intuitive, syntax is “yield from works regardless”, and anything else will inevitably fall short of that, which needs to at least be taken into account as a potential downside. Of course, it’s fine to say “we’re aware of this downside and we feel that the benefits outweigh the cost”.

For clarity: imo, yield from meaning “yield from async in async” and async yield from not existing (and there being no way to write “yield from sync in async”) would be much better (more intuitive) than the proposal written. I still don’t think it’s needed - but when I saw the PEP, I thought that that was what it was going to propose, and had that been the case I would have let it be.