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

Confusing text about __all__ in __init__.py in tutorial #71261

Closed
ztane mannequin opened this issue May 21, 2016 · 2 comments
Closed

Confusing text about __all__ in __init__.py in tutorial #71261

ztane mannequin opened this issue May 21, 2016 · 2 comments
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@ztane
Copy link
Mannequin

ztane mannequin commented May 21, 2016

BPO 27074
Nosy @ericsnowcurrently, @ztane

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 2016-05-21.07:45:05.669>
labels = ['type-feature', 'docs']
title = 'Confusing text about __all__ in __init__.py in tutorial'
updated_at = <Date 2021-06-22.21:16:18.466>
user = 'https://github.com/ztane'

bugs.python.org fields:

activity = <Date 2021-06-22.21:16:18.466>
actor = 'iritkatriel'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2016-05-21.07:45:05.669>
creator = 'ztane'
dependencies = []
files = []
hgrepos = []
issue_num = 27074
keywords = []
message_count = 1.0
messages = ['265990']
nosy_count = 3.0
nosy_names = ['docs@python', 'eric.snow', 'ztane']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue27074'
versions = []

Linked PRs

@ztane
Copy link
Mannequin Author

ztane mannequin commented May 21, 2016

https://docs.python.org/3/tutorial/modules.html#importing-from-a-package

says that

"The import statement uses the following convention: if a package’s __init__.py code defines a list named __all__, it is taken to be the list of module names that should be imported when from package import * is encountered."

However, of course this is not true. The behaviour is that __all__ lists the names that are to be imported from the package with from package import *; only only those names that raise AttributeError at the time of import would be attempted to be imported as submodules.

@ztane ztane mannequin assigned docspython May 21, 2016
@ztane ztane mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels May 21, 2016
@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 Jul 23, 2023
…ts (pythonGH-107004)

(cherry picked from commit 680f3e1)

Co-authored-by: wulmer <wulmer@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 23, 2023
…ts (pythonGH-107004)

(cherry picked from commit 680f3e1)

Co-authored-by: wulmer <wulmer@users.noreply.github.com>
hugovk pushed a commit that referenced this issue Jul 23, 2023
…rts (GH-107004) (#107100)

Co-authored-by: wulmer <wulmer@users.noreply.github.com>
hugovk pushed a commit that referenced this issue Jul 23, 2023
…rts (GH-107004) (#107099)

Co-authored-by: wulmer <wulmer@users.noreply.github.com>
@hugovk
Copy link
Member

hugovk commented Jul 23, 2023

Thanks, fixed during the EuroPython 2023 sprint!

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 type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant