<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Having followed Yury Selivanov yselivanov.ml at <a href="http://gmail.com" class="">gmail.com</a> proposal to add async/await to Python (PEP 492 Coroutines with async and await syntax and (PEP 525 Asynchronous Generators) and and especially the discussion about PEP 530: Asynchronous Comprehensions I would like to add some concerns about the direction Python is taking on this.<br class=""><br class="">As Sven R. Kunze srkunze at <a href="http://mail.de" class="">mail.de</a> mentions the is a risk of having to double a lot of methods/functions to have an Async implementation. Just look at the mess in .NET when Microsoft introduced async/await in their library, a huge number of functions had to be implemented with a Async version of each member. Definitely not the DRY principle.<br class=""><br class="">While I think parallelism and concurrency are very important features in a language, I feel the direction Python is taking right now is getting to complicated, being difficult to understand and implement correct.<br class=""><br class="">I thought it might be worth to look at using async at a higher level. Instead of making methods, generators and lists async, why not make the object itself async? Meaning that the method call (message to object) is async<br class=""><br class="">Example:<br class=""><br class="">class SomeClass(object):<br class=""> def some_method(self):<br class=""> return 42<br class=""><br class="">o = async SomeClass() # Indicating that the user want’s an async version of the object<br class="">r = o.some_method() # Will implicit be a async/await “wrapped” method no matter impl.<br class=""># Here other code could execute, until the result (r) is referenced<br class="">print r<br class=""><br class="">I think above code is easier to implement, use and understand, while it handles some of the use cases handled by defining a lot of methods as async/await.<br class=""><br class="">I have made a small implementation called PYWORKS (<a href="https://github.com/pylots/pyworks" class="">https://github.com/pylots/pyworks</a>), somewhat based on the idea above. PYWORKS has been used in several real world implementation and seams to be fairly easy for developers to understand and use.<br class=""><br class="">br<br class="">/Rene<br class=""><br class="">PS. This is my first post to python-ideas, please be gentle :-)</body></html>