classification
Title: Unclear definition of the "__future__" module in Docs
Type: enhancement Stage:
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: StevenHsuYL, docs@python, steven.daprano
Priority: normal Keywords:

Created on 2021-07-21 08:45 by StevenHsuYL, last changed 2021-07-21 12:54 by StevenHsuYL.

Messages (3)
msg397931 - (view) Author: Steven Hsu (StevenHsuYL) * Date: 2021-07-21 08:45
In Doc/glossary.rst, the first sentence of the entry "__future__" is that "A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter."

However, in Doc/library/__future__.rst, the first sentence is that ":mod:`__future__` is a real module, and serves three purposes:"

Is there any contradiction of these two descriptions, that "pseuso-module" and "real module" refer to the same module?

And if so, should we fix one of them?

Thanks for review!
msg397933 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2021-07-21 08:55
I agree that the contradiction should be resolved.

There is an actual `__future__.py` module, which on my system it is at /usr/local/lib/python3.9/__future__.py

But when we use the special syntax:

    from __future__ import <feature>

it doesn't do a normal import of the `__future__.py` module, it is actually a compiler directive.
msg397944 - (view) Author: Steven Hsu (StevenHsuYL) * Date: 2021-07-21 12:54
It sounds like that both descriptions (pseudo- and real) are true in different points of view on the __future__ module.

I have no idea how to resolve this contradiction of the original design of the module. Any suggestion?

Thanks for reply.
History
Date User Action Args
2021-07-21 12:54:44StevenHsuYLsetmessages: + msg397944
2021-07-21 08:55:50steven.dapranosetnosy: + steven.daprano
messages: + msg397933
2021-07-21 08:45:17StevenHsuYLcreate