[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-08-13 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

AFAIK this is already resolved on the main (https://bugs.python.org/issue42725)

--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-08-13 Thread Mark Shannon


Mark Shannon  added the comment:

I guess this will be resolved when the great PEP 563/649 debate is concluded. 
No need for another issue.

--
resolution:  -> duplicate
stage: patch review -> 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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-07 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Well even though I still don't understand 'how this issue is different than 
issue42725', I don't think you actually fix the symbol table;
see this one: https://bugs.python.org/msg383659

Annotations still have side effects on the symbol table (even though they 
shouldn't have). and I already had a fix but decided not to go for it until 
issue42737 is resolved since it would make the language inconsistent. Just FYI.

--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-07 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum, lys.nikolaou, pablogsal

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Mark Shannon


Mark Shannon  added the comment:

OK, I won't merge anything yet.

--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Then why not fix the compiler?

As I understand, it is not clear yet what behavior should be, and discussing it 
is the matter of issue42725. Any changes before the decision be made are 
preliminary.

It is very likely that the decision will be in favor of ignoring annotations. 
In that case your PR or even more radical changes can be merged.

--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Mark Shannon


Mark Shannon  added the comment:

The aim is to change the behavior of the symbol table to match the compiler.
The behavior has already changed at module scope.

Python 3.9.0+
>>> x:(yield None)
  File "", line 1
SyntaxError: 'yield' outside function
>>> 


Python 3.10.0a4+
>>> x:(yield None)
>>>

--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Does not it change the current behavior? I do not see a difference with 
issue42725.

>>> def f():
... x: (yield)
... 
>>> f()


--

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +22967
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/24138

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Mark Shannon


Mark Shannon  added the comment:

No this is not a duplicate.
This is about making the symbol table correct for current semantics.
#42725 is about changing the behavior

--
resolution: duplicate -> 
status: closed -> open
superseder: PEP 563: Should the behavior change for yield/yield from's -> 

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue42725.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> PEP 563: Should the behavior change for yield/yield from's

___
Python tracker 

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



[issue42837] Symbol table incorrectly identifies code as a generator, when 'yield' occurs in an annotation

2021-01-06 Thread Mark Shannon


New submission from Mark Shannon :

This is an internal inconsistency. I have not identified any surface level 
bugs, but it is a trap for future compiler work.

--
assignee: Mark.Shannon
messages: 384479
nosy: Mark.Shannon, larry
priority: normal
severity: normal
status: open
title: Symbol table incorrectly identifies code as a generator, when 'yield' 
occurs in an annotation

___
Python tracker 

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