[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-21 Thread Éric Araujo
Change by Éric Araujo : -- stage: resolved -> versions: +Python 3.11 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-21 Thread Éric Araujo
Éric Araujo added the comment: I am not sure. Adding compiler people to the nosy list! -- nosy: +BTaskaya, Mark.Shannon, benjamin.peterson, brett.cannon, pablogsal, yselivanov ___ Python tracker ___

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-19 Thread Saul Shanabrook
Saul Shanabrook added the comment: Thanks Éric! Do you think it would make sense to add the future flags as well to the inspect flags documentation (https://docs.python.org/3/library/inspect.html#code-objects-bit-flags) and to the dis.pretty_flags? -- __

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-19 Thread Éric Araujo
Éric Araujo added the comment: No worry about posting multiple messages. I think the flag is documented through the __future__ module. Future imports are both special-cased by the compiler to enable custom behaviour, but also real, regular imports! >>> from __future__ import annotations

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook
Saul Shanabrook added the comment: Actually, keeping this open. I am still unclear if this is expected behavior or not, but I do notice that the dis module is unable to read the flag when the annotations future is imported. For example `dis.pretty_flags(compile("from __future__ import anno

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook
Saul Shanabrook added the comment: I am closing this because, I realized I was unclear on whether the future flags end up as code flags. I thought we were just missing this one, but then realized that none of the other future flags are documented either. I had found a flag that was not recog

[issue45805] CO_FUTURE_ANNOTATIONS flag is not documented or in inspect

2021-11-14 Thread Saul Shanabrook
New submission from Saul Shanabrook : The CO_FUTURE_ANNOTATIONS code flag was added in Python 3.7 I believe in this PR https://github.com/python/cpython/pull/4390. However, it does not appear in dis's COMPILER_FLAG_NAMES map and so is not documented in inspect or pretty printed. I believe th