Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__future__.py and its documentation claim absolute imports became mandatory in 2.7, but they didn't #58699

Closed
smarnach mannequin opened this issue Apr 4, 2012 · 3 comments
Labels
docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@smarnach
Copy link
Mannequin

smarnach mannequin commented Apr 4, 2012

BPO 14494
Nosy @ericsnowcurrently, @akheron, @smarnach
Files
  • absolute_import.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2012-05-19.15:47:50.767>
    created_at = <Date 2012-04-04.12:53:05.844>
    labels = ['type-bug', 'library', 'docs']
    title = "__future__.py and its documentation claim absolute imports became mandatory in 2.7, but they didn't"
    updated_at = <Date 2012-05-19.15:47:50.766>
    user = 'https://github.com/smarnach'

    bugs.python.org fields:

    activity = <Date 2012-05-19.15:47:50.766>
    actor = 'petri.lehtinen'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2012-05-19.15:47:50.767>
    closer = 'petri.lehtinen'
    components = ['Documentation', 'Library (Lib)']
    creation = <Date 2012-04-04.12:53:05.844>
    creator = 'smarnach'
    dependencies = []
    files = ['25118']
    hgrepos = []
    issue_num = 14494
    keywords = ['patch']
    message_count = 3.0
    messages = ['157474', '161131', '161133']
    nosy_count = 5.0
    nosy_names = ['docs@python', 'python-dev', 'eric.snow', 'petri.lehtinen', 'smarnach']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue14494'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @smarnach
    Copy link
    Mannequin Author

    smarnach mannequin commented Apr 4, 2012

    As has been pointed out before on python-dev 1, the mandatory version of '__future__.absolute_import' does not match reality. In Python 2.7, absolute imports are not the default.

    The attached patch should fix the documentation and Lib/future.py. I set the mandatory version to (3, 0, 0, "alpha", 0), in accordance with other features that became mandatory in Py3k, though there never was a 3.0a0 release. I double-checked that absolute imports already were the default in 3.0a1.

    The patch should probably be applied to all branches.

    @smarnach smarnach mannequin assigned docspython Apr 4, 2012
    @smarnach smarnach mannequin added docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 4, 2012
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 19, 2012

    New changeset cc9e5ddd8220 by Petri Lehtinen in branch '2.7':
    bpo-14494: Document that absolute imports became default in 3.0 instead of 2.7.
    http://hg.python.org/cpython/rev/cc9e5ddd8220

    New changeset 7cdc1392173f by Petri Lehtinen in branch '3.2':
    bpo-14494: Document that absolute imports became default in 3.0 instead of 2.7.
    http://hg.python.org/cpython/rev/7cdc1392173f

    New changeset 26661d9bbb36 by Petri Lehtinen in branch 'default':
    bpo-14494: Document that absolute imports became default in 3.0 instead of 2.7.
    http://hg.python.org/cpython/rev/26661d9bbb36

    @akheron
    Copy link
    Member

    akheron commented May 19, 2012

    Fixed, thanks for the patch.

    BTW, you should sign the PSF Contributor Agreement. See http://www.python.org/psf/contrib/.

    @akheron akheron closed this as completed May 19, 2012
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant