[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

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



[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?

--

___
Python tracker 

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



[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
>>> annotations
_Feature((3, 7, 0, 'beta', 1), (3, 10, 0, 'alpha', 0), 16777216)
>>> hex(annotations.compiler_flag)
'0x100'

--
nosy: +eric.araujo

___
Python tracker 

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



[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 annotations", "", 
"exec").co_flags)` return `'NOFREE, 0x100'`. 

Sorry for the repeated messages.

--
status: closed -> open

___
Python tracker 

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



[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 recognized, 0x100, and for some reason 
thought it was related to the future annotations import.

--
stage:  -> 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



[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 the fix would be to add it to the dict in dis as well as document it 
in inspect.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 406309
nosy: docs@python, saulshanabrook
priority: normal
severity: normal
status: open
title: CO_FUTURE_ANNOTATIONS flag is not documented or in inspect
versions: Python 3.7

___
Python tracker 

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