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

[doc] Inconsistent / confusing documentation regarding importing submodules #87304

Closed
DirkHerrmann mannequin opened this issue Feb 5, 2021 · 2 comments
Closed

[doc] Inconsistent / confusing documentation regarding importing submodules #87304

DirkHerrmann mannequin opened this issue Feb 5, 2021 · 2 comments
Labels
3.10 docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@DirkHerrmann
Copy link
Mannequin

DirkHerrmann mannequin commented Feb 5, 2021

BPO 43138

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 = None
created_at = <Date 2021-02-05.17:33:30.976>
labels = ['type-feature', '3.10', 'docs']
title = '[doc] Inconsistent / confusing documentation regarding importing submodules'
updated_at = <Date 2021-02-05.17:33:30.976>
user = 'https://bugs.python.org/DirkHerrmann'

bugs.python.org fields:

activity = <Date 2021-02-05.17:33:30.976>
actor = 'Dirk Herrmann'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2021-02-05.17:33:30.976>
creator = 'Dirk Herrmann'
dependencies = []
files = []
hgrepos = []
issue_num = 43138
keywords = []
message_count = 1.0
messages = ['386532']
nosy_count = 2.0
nosy_names = ['docs@python', 'Dirk Herrmann']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue43138'
versions = ['Python 3.10']

@DirkHerrmann
Copy link
Mannequin Author

DirkHerrmann mannequin commented Feb 5, 2021

In the language reference, section "7.11 The import statement" is is explained in the example section:

   import foo.bar.baz         # foo.bar.baz imported, foo bound locally

When looking at "5.3. Searching", it is stated that regarding foo.bar.baz:

In this case, Python first tries to import foo, then foo.bar, and finally foo.bar.baz.

I find this confusing. Assuming that 5.3 is correct, the examples in 7.11 could be improved, like, for the sample line mentioned above:

   import foo.bar.baz         # foo, foo.bar and foo.bar.baz imported, foo bound locally

@DirkHerrmann DirkHerrmann mannequin added the 3.10 label Feb 5, 2021
@DirkHerrmann DirkHerrmann mannequin assigned docspython Feb 5, 2021
@DirkHerrmann DirkHerrmann mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Feb 5, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 3, 2022
…ythonGH-92164)

(cherry picked from commit ee2205b)

Co-authored-by: Robert Yang <35813883+robert861212@users.noreply.github.com>
miss-islington added a commit that referenced this issue May 3, 2022
(cherry picked from commit ee2205b)

Co-authored-by: Robert Yang <35813883+robert861212@users.noreply.github.com>
miss-islington added a commit that referenced this issue May 3, 2022
(cherry picked from commit ee2205b)

Co-authored-by: Robert Yang <35813883+robert861212@users.noreply.github.com>
@hauntsaninja
Copy link
Contributor

hauntsaninja commented May 13, 2022

Thanks, seems like this can be closed now

hello-adam pushed a commit to hello-adam/cpython that referenced this issue Jun 2, 2022
…ythonGH-92164)

(cherry picked from commit ee2205b)

Co-authored-by: Robert Yang <35813883+robert861212@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant