Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

__future__ imports allow dots before them #118216

Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
@thatbirdguythatuknownot

Description

Bug report

Bug description:

__future__ imports don't check the amount of dots while checkingfrom-import nodes for the module name, so they are still valid even if dots are put before the module name.

>>>from .__future__import barry_as_FLUFLTraceback (most recent call last):  File "<stdin>", line 1, in <module>    from .__future__ import barry_as_FLUFLImportError: attempted relative import with no known parent package>>>1<>2True

Is this intended? Allowing dots before the module name seems improper considering__future__ is supposed to be part of the stdlib.

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp