> Here's the section of documentation I've just written for
> _q_resolve(). Everyone, please suggest clarifications. (Apologies
> for the RST markup.)
For the most part it looks good.
> ``name`` is a string containing the next chunk of the path.
> ``_q_resolve()`` should do whatever imports are necessary and return a
> module that will be traversed further. (Other things can be returned,
> such as class instances or whatever, but modules are likely to be the
> most common return type.)
"or whatever" strikes me as a bit vague for what is supposed to be the
definitive documentation. How about something like:
(Other things can also be returned, including a class instance that
might be traversed further, or a callable object (or even a string)
if the last component of the path is being resolved).
Sorry if it's hard to read; I'm fighting off a case of the Mongolian Death
Flu I got from my kids, so if it looks like I'm thinking through mud, it's
because I am...
With regard to exceptions, I think you should get the same result that you
get without a _q_resolve, or if you forget a _q_exports entry; that's
generally a TraversalError, I think. It's pretty much the same error...
jon
Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net