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

Have importlib use return value from a loader's load_module() #58787

Closed
brettcannon opened this issue Apr 14, 2012 · 4 comments
Closed

Have importlib use return value from a loader's load_module() #58787

brettcannon opened this issue Apr 14, 2012 · 4 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@brettcannon
Copy link
Member

BPO 14582
Nosy @brettcannon, @ericsnowcurrently

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 = 'https://github.com/brettcannon'
closed_at = <Date 2012-04-15.19:25:55.317>
created_at = <Date 2012-04-14.20:31:40.515>
labels = ['interpreter-core', 'performance']
title = "Have importlib use return value from a loader's load_module()"
updated_at = <Date 2012-04-18.14:55:51.991>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2012-04-18.14:55:51.991>
actor = 'python-dev'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2012-04-15.19:25:55.317>
closer = 'brett.cannon'
components = ['Interpreter Core']
creation = <Date 2012-04-14.20:31:40.515>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 14582
keywords = []
message_count = 4.0
messages = ['158280', '158284', '158356', '158629']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'python-dev', 'eric.snow']
pr_nums = []
priority = 'low'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'performance'
url = 'https://bugs.python.org/issue14582'
versions = ['Python 3.3']

@brettcannon
Copy link
Member Author

Right now importlib doesn't use what loader.load_module() returns as that was what import.c did. But PEP-302 explicitly states that load_module() is expected to return the module that was loaded. So to save a dict lookup I want to rely on the return value of load_module().

@brettcannon brettcannon self-assigned this Apr 14, 2012
@brettcannon brettcannon added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Apr 14, 2012
@ericsnowcurrently
Copy link
Member

big +1! I went quite a while before realizing that loader.load_module() was supposed to return the module, due to this specific issue.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Apr 15, 2012

New changeset 005fd1fe31ab by Brett Cannon in branch 'default':
Issue bpo-14582: Import returns the module returned by a loader instead
http://hg.python.org/cpython/rev/005fd1fe31ab

@python-dev
Copy link
Mannequin

python-dev mannequin commented Apr 18, 2012

New changeset db5e3431ee4c by Benjamin Peterson in branch 'default':
rollback 005fd1fe31ab (see bpo-14609 and bpo-14582)
http://hg.python.org/cpython/rev/db5e3431ee4c

@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
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

2 participants