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

Document imp.NullImporter is NOT used anymore by import #61378

Closed
brettcannon opened this issue Feb 10, 2013 · 4 comments
Closed

Document imp.NullImporter is NOT used anymore by import #61378

brettcannon opened this issue Feb 10, 2013 · 4 comments
Assignees
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@brettcannon
Copy link
Member

BPO 17176
Nosy @brettcannon, @ezio-melotti, @pelme

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-03-13.18:11:30.595>
created_at = <Date 2013-02-10.19:50:27.505>
labels = ['easy', 'type-feature', 'docs']
title = 'Document imp.NullImporter is NOT used anymore by import'
updated_at = <Date 2013-03-13.18:11:30.594>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2013-03-13.18:11:30.594>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2013-03-13.18:11:30.595>
closer = 'brett.cannon'
components = ['Documentation']
creation = <Date 2013-02-10.19:50:27.505>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 17176
keywords = ['easy']
message_count = 4.0
messages = ['181846', '182767', '182885', '184095']
nosy_count = 4.0
nosy_names = ['brett.cannon', 'ezio.melotti', 'python-dev', 'Andreas.Pelme']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'needs patch'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue17176'
versions = ['Python 3.3', 'Python 3.4']

@brettcannon
Copy link
Member Author

imp.NullImporter should not be claiming that it is still used to fill sys.path_importer_cache on misses.

@brettcannon brettcannon self-assigned this Feb 10, 2013
@brettcannon brettcannon added the docs Documentation in the Doc dir label Feb 10, 2013
@ezio-melotti ezio-melotti added easy type-feature A feature request or enhancement labels Feb 15, 2013
@pelme
Copy link
Mannequin

pelme mannequin commented Feb 23, 2013

This seems like an oversight from

http://bugs.python.org/issue15473

The release notes for 3.3 added a note about this:
"Because None is now inserted into sys.path_importer_cache, if you are clearing out entries in the dictionary of paths that do not have a finder, you will need to remove keys paired with values of None and imp.NullImporter to be backwards-compatible. This will lead to extra overhead on older versions of Python that re-insert None into sys.path_importer_cache where it repesents the use of implicit finders, but semantically it should not change anything."

But the relevant docs for NullImporter (http://docs.python.org/2/library/imp.html#imp.NullImporter) and sys.path_importer_cache (http://docs.python.org/2/library/sys.html#sys.path_importer_cache) did not get updated.

We have verified that the release notes in 3.4 is correct, and NullImporter is never used.

We are however not sure about the correct wording for the documentation fix.

@brettcannon
Copy link
Member Author

The docs for NullImporter need to not mention that it is used with sys.path_importer_cache since it isn't. As for sys.path_importer_cache, it should say that None is inserted and not NullImporter. Both need a versionchanged notation of the switch from None to NullImporter, but sys.path_importer_cache needs a special mention that to be fully backwards-compatible to check for both None and NullImporter.

And just to make sure you are looking at the right docs, Andreas, your links were to the Python 2.7 docs. If you look at the top of the docs you will see a dropdown which lets you switch to the 3.3 or 3.4 docs easily.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Mar 13, 2013

New changeset 8e390e4784b0 by Brett Cannon in branch 'default':
Issue bpo-17176: Document that imp.NullImporter is no longer inserted
http://hg.python.org/cpython/rev/8e390e4784b0

New changeset e470370b4701 by Brett Cannon in branch '3.3':
Issue bpo-17176: Document that imp.NullImporter is no longer
http://hg.python.org/cpython/rev/e470370b4701

@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
docs Documentation in the Doc dir easy type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants