New submission from Carl Friedrich Bolz-Tereick <cfb...@gmx.de>:

PEP 563 interacts in weird ways with constant folding. running the following 
code:

```
from __future__ import annotations

def f(a: 5 + 7) -> a ** 39:
    return 12

print(f.__annotations__)
```

I would expect this output:

```
{'a': '5 + 7', 'return': 'a ** 39'}
```

But I get:


```
{'a': '12', 'return': 'a ** 39'}
```

----------
components: Interpreter Core
files: x.py
messages: 359341
nosy: Carl.Friedrich.Bolz
priority: normal
severity: normal
status: open
title: constant folding affects annotations despite 'from __future__ import 
annotations'
versions: Python 3.7
Added file: https://bugs.python.org/file48827/x.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39220>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to