[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-09 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 28d8d14013ade0657fed4673f5fa3c08eb2b1944 by Andrew Svetlov in branch 'master': bpo-32253: Deprecate with statement and bare await for asyncio locks (GH-4764)

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-09 Thread Yury Selivanov
Yury Selivanov added the comment: > This can make harder writing portable code that works in 2.7, 3.4 and 3.7. asyncio for Python 3.4 is fairly outdated. Most of the async packages today require 3.5+, as they usually use async/await syntax. I say this sort of

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-09 Thread Andrew Svetlov
Andrew Svetlov added the comment: 1. asyncio is not supported by 2.7 anyway 2. with (yield from lock) is based on very non-obvious tricks: a) lock.__enter__ is forbidden and raises RuntimeError b) actually lock.__iter__ is called for lock acquiring *before* calling

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This can make harder writing portable code that works in 2.7, 3.4 and 3.7. What is the benefit of the deprecation? Are there inevitable design or implementation errors in these constructions? Or getting rid of them can

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-09 Thread Andrew Svetlov
Change by Andrew Svetlov : -- keywords: +patch pull_requests: +4667 stage: -> patch review ___ Python tracker ___

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-08 Thread Andrew Svetlov
Change by Andrew Svetlov : -- components: +Library (Lib) ___ Python tracker ___

[issue32253] Deprecate old-style locking in asyncio/locks.py

2017-12-08 Thread Andrew Svetlov
New submission from Andrew Svetlov : Now constructions like await lock # "yield from lock" can be used as well try: ... finally: lock.release() and with (yield from lock): ... are supported. Let's deprecate them in favor of async with lock: ...