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

Create importlib.abc.Loader.init_module_attrs() #62288

Closed
brettcannon opened this issue May 29, 2013 · 2 comments
Closed

Create importlib.abc.Loader.init_module_attrs() #62288

brettcannon opened this issue May 29, 2013 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 18088
Nosy @brettcannon

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 2013-05-31.22:59:34.453>
created_at = <Date 2013-05-29.00:08:15.956>
labels = ['type-feature', 'library']
title = 'Create importlib.abc.Loader.init_module_attrs()'
updated_at = <Date 2013-05-31.22:59:34.452>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2013-05-31.22:59:34.452>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2013-05-31.22:59:34.453>
closer = 'brett.cannon'
components = ['Library (Lib)']
creation = <Date 2013-05-29.00:08:15.956>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 18088
keywords = []
message_count = 2.0
messages = ['190260', '190423']
nosy_count = 2.0
nosy_names = ['brett.cannon', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue18088'
versions = ['Python 3.4']

@brettcannon
Copy link
Member Author

There are a bunch of attributes that need to be set on a module, and yet they are only handled by various decorators in importlib.util. The problem with that is there is no way in the API to override or expand upon setting those attributes pre-loading; only post-loading like what set_loader and set_package do.

importlib.abc.Loader.init_module_attrs(module) would take a module and then using whatever methods are available, sets as many attributes as possible. This method can either be called before execution of the module's code or after some function is called that directly returns a loaded module (e.g. BuiltinImporter).

@brettcannon brettcannon self-assigned this May 29, 2013
@brettcannon brettcannon added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels May 29, 2013
@python-dev
Copy link
Mannequin

python-dev mannequin commented May 31, 2013

New changeset e873f2e67353 by Brett Cannon in branch 'default':
Issues bpo-18088, 18089: Introduce
http://hg.python.org/cpython/rev/e873f2e67353

@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
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant