[issue15295] Import machinery documentation

2012-08-02 Thread Nick Coghlan
Nick Coghlan added the comment: We changed quite a bit already as we tried to make everything consistent, including the importlib ABCs. Current version is on trunk, current discussion is in #15502 -- ___ Python tracker

[issue15295] Import machinery documentation

2012-08-02 Thread Phillip J. Eby
Phillip J. Eby added the comment: Hope I'm not too late to the bikeshed painting party; just wanted to chip in with the suggestion of "self-contained package" for non-namespace packages. (i.e., a self-contained package is one that cannot be split across different sys.path entries due to its u

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 31, 2012, at 02:56 PM, Eric Snow wrote: >Part of the problem with the import nomenclature is that PEP 302 doesn't >really nail it down and mixes the terms up a bit. This is understandable >considering it broken ground in some regard. However, at this p

[issue15295] Import machinery documentation

2012-07-31 Thread Brett Cannon
Brett Cannon added the comment: I guess just saying it can be None depending on context would be enough. -- ___ Python tracker ___ ___

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 31, 2012, at 08:30 PM, Brett Cannon wrote: >The import path definition is a little misleading as sys.path is only >inferred when 'path' has None passed in. Otherwise 'path' is what __path__ in >a package is set to, so technically sys.path never even come

[issue15295] Import machinery documentation

2012-07-31 Thread Brett Cannon
Brett Cannon added the comment: The import path definition is a little misleading as sys.path is only inferred when 'path' has None passed in. Otherwise 'path' is what __path__ in a package is set to, so technically sys.path never even comes into play except by choice from PathFinder as it jus

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue15295] Import machinery documentation

2012-07-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset c933ec7cafcf by Barry Warsaw in branch 'default': Address substantially all of Eric Snow's comments in issue #15295, except for http://hg.python.org/cpython/rev/c933ec7cafcf New changeset d5317b8f455a by Barry Warsaw in branch 'default': - Issue #15

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 31, 2012, at 03:21 AM, Eric Snow wrote: >1. default path importer (a.k.a PathFinder), +1, although currently I am refraining from using "default" when describing this thing. >2. path hook (lives on sys.path_hooks), I have called these "path entry hook

[issue15295] Import machinery documentation

2012-07-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Shouldn't it be committed already? I don't see the point of refining documentation in a separate repo rather than in the main repo. -- nosy: +pitrou ___ Python tracker ___

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I think I was unclear in my previous follow up. Here are the objects involved, taken from the glossary. import path A list of locations (or :term:`path entries `) that are searched by the :term:`path importer` for modules to import. During

[issue15295] Import machinery documentation

2012-07-31 Thread Eric Snow
Eric Snow added the comment: Well, I'm more -0 than -1 on "path importer", though I do like "default path importer" better. As to the rest, sounds good to me. -- ___ Python tracker __

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 31, 2012, at 12:28 AM, Eric Snow wrote: >> You ask in [2] whether "path importer" refers specifically to the callables >> on sys.path_hooks. Can you site a reference for this? I found one >> reference in PEP 302 to "path importer" but it's hard to tell

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 30, 2012, at 09:41 PM, Brett Cannon wrote: >As for the diagram(s), I have attached the overall PDF that I still have from >my original Omnifgraffle file (which I don't have a license to anymore) that >I built my PyCon 2008 presentation with. It's probabl

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 29, 2012, at 06:09 AM, Nick Coghlan wrote: >runpy, pkgutil, et al should all get "See Also" links at the top pointing to >the new import system section. I've put an XXX in the import.rst file for this, but I probably won't get to adding all the cross re

[issue15295] Import machinery documentation

2012-07-31 Thread Eric Snow
Eric Snow added the comment: Part of the problem with the import nomenclature is that PEP 302 doesn't really nail it down and mixes the terms up a bit. This is understandable considering it broken ground in some regard. However, at this point we have a more comfortable relationship with the

[issue15295] Import machinery documentation

2012-07-31 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jul 29, 2012, at 05:10 AM, Nick Coghlan wrote: >I would title the new section "Import system" rather than "Import machinery" >as it is meant to be a specification documentation rather than an >implementation description. "Import system" it is. >The stateme

[issue15295] Import machinery documentation

2012-07-31 Thread Brett Cannon
Brett Cannon added the comment: While saying "default path importer" vs. "meta path finder" somewhat muddles the term "importer", it definitely gets the point across that PathFinder does a lot more than any other default meta path finder. While _we_ might know that import does nothing more tha

[issue15295] Import machinery documentation

2012-07-30 Thread Eric Snow
Eric Snow added the comment: More on import-related terms. Given Nick's recommendation, here's a broader view, as related to the import state: sys.meta_path: "meta path finder" -> "module loader" sys.meta_path[-1] (initially): "default path importer" sys.path_hooks: "path hook" -> "path

[issue15295] Import machinery documentation

2012-07-30 Thread Eric Snow
Eric Snow added the comment: Sounds good to me. As I understood them: 1. default path importer (a.k.a PathFinder), 2. path hook (lives on sys.path_hooks), 3. path entry handler (finder look-alike that a path hook returns), 4. module loader (business as usual). A "path entry handler" would stan

[issue15295] Import machinery documentation

2012-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: s/locate path entry finders/appropriate path entry handlers/ -- ___ Python tracker ___ ___ Python-bugs

[issue15295] Import machinery documentation

2012-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: As far as the path importer goes, it's important to keep in mind there are *four* different pieces in play: 1. The path importer itself This is a meta path finder installed on sys.meta_path, which implements the find_module API. It scans the supplied search pat

[issue15295] Import machinery documentation

2012-07-30 Thread Eric Snow
Eric Snow added the comment: > I certainly struggled with this term. I almost picked PathFinder (or "path > finder") since that's the name of the actual class used in the implementation, > but then I thought this might be too implementation specific. Considering that the goal is for importlib t

[issue15295] Import machinery documentation

2012-07-30 Thread Brett Cannon
Brett Cannon added the comment: To answer a couple of Barry's comments in reply to Eric... __package__ should be set to the empty string if I'm reading PEP 362 correctly (and importlib isn't broken): "When the import system encounters an explicit relative import in a module without __package__

[issue15295] Import machinery documentation

2012-07-30 Thread Éric Araujo
Éric Araujo added the comment: A small note in passing: “protocol” is used for things like the sequence protocol, the iterator protocol, or closer to home the finder and loader protocols, so it would sound weird or potentially confusing to me. Import system is how I’ve always thought about it

[issue15295] Import machinery documentation

2012-07-30 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Thanks for the review Eric. I'm slogging through these and many other comments, but I now have the docs integrated with trunk, and will probably land them for better or worse in the next day or so. I'll respond just to a few of your comments. Whatever I omit

[issue15295] Import machinery documentation

2012-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: #15502 records Brett concern about the merged ABC -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue15295] Import machinery documentation

2012-07-30 Thread Nick Coghlan
Nick Coghlan added the comment: Ah, the perils of email readers with quote folding and issue trackers without it. The important part of Brett's email is that PEP 420 has started splitting the meta path finder and path entry finder APIs, but importlib still uses a single ABC for both of them. T

[issue15295] Import machinery documentation

2012-07-29 Thread Brett Cannon
Brett Cannon added the comment: On Jul 29, 2012 2:09 AM, "Nick Coghlan" wrote: > > > Nick Coghlan added the comment: > > General comment: > > runpy, pkgutil, et al should all get "See Also" links at the top pointing to the new import system section. > > Import system intro: > > As noted above, I

[issue15295] Import machinery documentation

2012-07-29 Thread Nick Coghlan
Nick Coghlan added the comment: Updated the statement docs to accurately describe the from X import Y case. I also noted that unlike the statement form, importlib.import_module ignores module level __import__ overrides. -- ___ Python tracker

[issue15295] Import machinery documentation

2012-07-28 Thread Nick Coghlan
Nick Coghlan added the comment: Pushed the import machinery -> import system change (which hopefully won't break Barry's world) Also merged in a more recent version of trunk. This probably screwed up the default branch in this clone, but the clone should be done after these docs updates. ---

[issue15295] Import machinery documentation

2012-07-28 Thread Nick Coghlan
Nick Coghlan added the comment: Great start here Barry, I'll switch my checkout over to read/write access and start contributing fixes. -- ___ Python tracker ___ ___

[issue15295] Import machinery documentation

2012-07-28 Thread Nick Coghlan
Nick Coghlan added the comment: General comment: runpy, pkgutil, et al should all get "See Also" links at the top pointing to the new import system section. Import system intro: As noted above, I suggest changing the name :) Opening section should refer to importlib.import_module(). Any ment

[issue15295] Import machinery documentation

2012-07-28 Thread Nick Coghlan
Nick Coghlan added the comment: I would title the new section "Import system" rather than "Import machinery" as it is meant to be a specification documentation rather than an implementation description. Import statement: The statement that "from X import A" only performs a single import looku

[issue15295] Import machinery documentation

2012-07-28 Thread Nick Coghlan
Changes by Nick Coghlan : -- hgrepos: +142 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue15295] Import machinery documentation

2012-07-27 Thread Eric Snow
Eric Snow added the comment: Awesome addition, Barry! Bless you for slogging through this. Here are some thoughts (prepare one grain of salt for each): * (glossary.rst) finder: should also reference PEP 420. * (glossary.rst) module: s/contain/containing/ * (glossary.rst) path importer: I lik

[issue15295] Import machinery documentation

2012-07-27 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- priority: deferred blocker -> release blocker stage: needs patch -> patch review title: Document PEP 420 namespace packages -> Import machinery documentation ___ Python tracker _