This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nchammas
Recipients nchammas
Date 2016-01-24.02:06:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1453601163.58.0.356009781594.issue26188@psf.upfronthosting.co.za>
In-reply-to
Content
Here is the user interaction:

```python
$ python3
Python 3.5.1 (default, Dec  7 2015, 21:59:10) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def oh_hai():
...     await something()
  File "<stdin>", line 2
    await something()
                  ^
SyntaxError: invalid syntax
```

It would be helpful if Python could tell the user something more specific about _why_ the syntax is invalid. Is that possible?

For example, in the case above, an error message along the following lines would be much more helpful:

```
SyntaxError: Cannot call `await` inside non-`async` method.
```

Without a hint like this, it's too easy to miss the obvious and waste time eye-balling the code, like I did. :-)
History
Date User Action Args
2016-01-24 02:06:03nchammassetrecipients: + nchammas
2016-01-24 02:06:03nchammassetmessageid: <1453601163.58.0.356009781594.issue26188@psf.upfronthosting.co.za>
2016-01-24 02:06:03nchammaslinkissue26188 messages
2016-01-24 02:06:01nchammascreate