[New-bugs-announce] [issue31973] Incomplete DeprecationWarning for async/await keywords

Barry A. Warsaw report at bugs.python.org
Tue Nov 7 18:15:49 EST 2017


New submission from Barry A. Warsaw <barry at python.org>:

Issue bpo-26182 added DeprecationWarnings for "import async" and "import await" since both of those pseudo-keywords were to become actual reserved keywords in Python 3.7.  This latter has now happened, but the fix in bpo-26182 is incomplete.  It does not trigger warnings on "from .async import foo".

base/
    __init__.py
    async.py
    good.py

-----async.py
x = 1

-----good.py
from .async import x


$ python3.6 -W error::DeprecationWarning -c "import base.good"
$ python3.7 -c "import base.good"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/x1/base/good.py", line 1
    from .async import x
              ^
SyntaxError: invalid syntax
$ cd base
$ python3.6 -W error::DeprecationWarning -c "import async"
DeprecationWarning: 'async' and 'await' will become reserved keywords in Python 3.7

----------
messages: 305798
nosy: barry
priority: normal
severity: normal
status: open
title: Incomplete DeprecationWarning for async/await keywords
versions: Python 3.6, Python 3.7

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


More information about the New-bugs-announce mailing list