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 exactly what >> that is referring to. > >Unfortunately not. There aren't many people that use import hook terminology >and I already have a terrible memory. :) Regardless, I find "path importer" a >little too ambiguous. Dang. I've grown to really like "path importer" for the thing on sys.meta_path that provides sys.path and related functionality. It seems appropriate given the observation that we're talking about sys.path or __path__ and what this thing does is manage that corner of the import subsystem. Thinking about Nick's suggestion then, the callables on sys.path_hooks would be "path entry finders" since they are given a chance to find modules for each entry on the import path (be it sys.path or __path__). I think this terminology holds together well, and I think I'm going to land it as such. Then we can promote this terminology as we talk about the import system in other documentation. >>>* (glossary.rst) sys path finder: having "sys" is a nice touch, making it >>>more distinct and more explicit. >> >> TBH, I'm not crazy about the term "sys path finder" either but I couldn't >> think of anything better. > >What don't you like about the "sys path thingee" names? I find them to be >nice and explicit. I'll mull this over some more. Nick put his finger on it. "sys path" implies that only sys.path is involved, whereas __path__ is also involved. >>>* (import_machinery.rst) Meta path loaders, end of paragraph 2: "The finder >>>* could also be a classmethod that returns an instance of the class." >> >> I don't understand what you're suggesting here. > >Yeah, that was poorly worded. I'd meant to suggest that you could document >the alternative to find_module() and load_module() being regular methods of >the same object. For instance: > >class MyMetaHook: > @classmethod > def find_module(cls, name, path=None): > return cls() > def load_module(self, name): > raise ImportError("You lose!") > >Thus, the "finder" is the class, and the "loader" is the instance. While true, it's not required in the specification, so I'd like to leave this out. Smart Pythonistas can figure details like that out. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15295> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com