[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2017-11-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests:  -970

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +970

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-11-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7a996e826f83 by Yury Selivanov in branch '3.6':
Issue #26182: Fix ia refleak in code that raises DeprecationWarning.
https://hg.python.org/cpython/rev/7a996e826f83

New changeset 7b0e79e7f567 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #26182)
https://hg.python.org/cpython/rev/7b0e79e7f567

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-15 Thread Brett Cannon

Brett Cannon added the comment:

Sorry I didn't get around to reviewing; I'm sick.

On Thu, Sep 15, 2016, 09:51 Yury Selivanov  wrote:

>
> Yury Selivanov added the comment:
>
> Merged.
>
> --
> resolution:  -> fixed
> stage: needs patch -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-15 Thread Yury Selivanov

Yury Selivanov added the comment:

Merged.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82e6017dc841 by Yury Selivanov in branch '3.6':
Issue #26182: Raise DeprecationWarning for improper use of async/await keywords
https://hg.python.org/cpython/rev/82e6017dc841

New changeset 3f8b75173543 by Yury Selivanov in branch 'default':
Merge 3.6 (issue #26182)
https://hg.python.org/cpython/rev/3f8b75173543

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-15 Thread Yury Selivanov

Yury Selivanov added the comment:

I'm going to commit the patch now (I'm going on vacation tomorrow, and I want 
to watch the buildbots).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-14 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-14 Thread Yury Selivanov

Yury Selivanov added the comment:

I had to rewrite the patch to make sure it reports correct position and covers 
all cases where using async/await should trigger a warning.

Brett, could you please take a look at the patch?

--
Added file: http://bugs.python.org/file44669/issue_26182.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-12 Thread Brett Cannon

Brett Cannon added the comment:

I'm fine with it being in b2 because IMO the warning really should make it in 
3.6 and for stuff like this it's more critical to hit the RC for people's 
testing than the beta to work out semantic changes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-12 Thread Ned Deily

Ned Deily added the comment:

As long as Brett is also OK with it, it can go in for 360b2.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-09-12 Thread Yury Selivanov

Yury Selivanov added the comment:

Ned, would it be OK to commit this patch after b1?

async/await are scheduled to become real keywords in 3.7.  Right now they are 
only keywords in 'async def' blocks, meaning that it's OK to have a class with 
'async' or 'await' attributes.

So this will be a backwards compatibility breaking change in 3.7.  This patch 
makes Python to emit a warning each time you use async or await as an 
attribute/variable/etc.

--
nosy: +gvanrossum, ned.deily
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-12 Thread Brett Cannon

Brett Cannon added the comment:

Because parsing is done before execution you can't flip on warnings during 
runtime in the file you to be affected.

As for the line number, that's because it's raise in C code that doesn't have a 
trigger in Python code. Try importing the code and you should get the line 
number of the import. Otherwise you will have to check if there is some 
function to specify a syntax warning that lets you set the line number 
explicitly (I don't think there is).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-12 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-12 Thread Marco Buttu

Marco Buttu added the comment:

Thank you Brett, the problem was the missed exec(). With the patch in 
attachment the tests pass, but it does not seem to me a good solution. Infact, 
changing the filter at runtime has no effect: 

$ cat foo.py 
import warnings

warnings.simplefilter("always")
async = 33
await = 33

$ ./python foo.py 
$

Does this happen because, putting the PyErr_WarnEx() in Python/ast.c, the 
warning is issued before the runtime?

Furthermore, if I set the filter from the CL, then the warning is properly 
triggered, but the file name and line number are wrong: 

$ ./python -Wd foo.py 
sys:1: DeprecationWarning: 'async' will become a reserved keyword in Python 3.7
sys:1: DeprecationWarning: 'await' will become a reserved keyword in Python 3.7

--
keywords: +patch
Added file: http://bugs.python.org/file41908/async_await.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 Thread Brett Cannon

Brett Cannon added the comment:

You need to temporarily turn on warnings for it to work. For example:

  with warnings.catch_warnings():
  warnings.simplefilter('always')
  with self.assertWarnsRegex(DeprecationWarning, "reserved keyword"):
exec('async = 33')

Do notice I used exec() as otherwise the warning will be triggered at import 
instead of when the test runs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-11 Thread Marco Buttu

Marco Buttu added the comment:

I added the PyErr_WarnEx(PyExc_DeprecationWarning, ...) in Python/ast.c, right 
below the check for None, True and False as names. Running the following test 
the message is properly printed:

def test_async(self):
with self.assertWarnsRegex(DeprecationWarning, "reserved keyword"):
async = 33

However, the test does not pass, because the DeprecationWarning is not 
triggered. I am sorry but as a cpython beginner I can not figure out how to 
solve the problem, so I hope someone else can find the time to do it

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-08 Thread STINNER Victor

STINNER Victor added the comment:

Oh thank. I didn't understand if you wanted to change Python 3.6 or 3.7.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26182] Deprecation warnings for the future async and await keywords in Python 3.6

2016-02-08 Thread Brett Cannon

Changes by Brett Cannon :


--
title: Deprecation warnings for the future async and await keywords -> 
Deprecation warnings for the future async and await keywords in Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com