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

Andrew Svetlov report at bugs.python.org
Sat Dec 9 04:48:55 EST 2017


Andrew Svetlov <andrew.svetlov at gmail.com> 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 `with`
  c) the object returned from __iter__ is a context manager with __enter__/__exit__ methods
3. asyncio is converted to async/await syntax by https://bugs.python.org/issue32193 (old `yield from` style is fully supported still).
4. the deprecation was proposed by Yury Selivanov in https://github.com/python/cpython/pull/4753#discussion_r155658200

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32253>
_______________________________________


More information about the Python-bugs-list mailing list