Issue 32564: Syntax error on using variable async (original) (raw)

Issue32564

Created on 2018-01-16 08:35 by Andrew Olefira, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg310045 - (view) Author: Andrew Olefira (Andrew Olefira) Date: 2018-01-16 08:35
In python 3.6 you can use name "async" for variable: >>> class A: ... async = True ... >>> but in python 3.7a4 you catch syntax error: >>> class A: ... async = True File "", line 2 async = True ^ SyntaxError: invalid syntax >>>
msg310047 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-01-16 08:42
See https://docs.python.org/3.7/whatsnew/3.5.html#new-keywords.
msg310054 - (view) Author: Andrew Olefira (Andrew Olefira) Date: 2018-01-16 09:01
Yes, I understand, but "not recommended" != "not allowed". For example library Pika (https://pypi.python.org/pypi/pika) use variable "async", so no one project that use lib Pika can't be launched on Python 3.7a4
msg310060 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-01-16 09:20
It raised a DeprecationWarning since 3.5. Most projects got rid of "async" and "await" identifiers before 3.7. File a bug in the Pika library.
History
Date User Action Args
2022-04-11 14:58:56 admin set github: 76745
2018-01-16 09:20:30 serhiy.storchaka set messages: +
2018-01-16 09:03:01 Andrew Olefira set status: open -> closedresolution: not a bugstage: resolved
2018-01-16 09:01:07 Andrew Olefira set messages: +
2018-01-16 08:42:04 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2018-01-16 08:35:47 Andrew Olefira create