durusmail: quixote-users: _q_resolve summary
_q_import summary
2003-01-21
2003-01-21
2003-01-21
_q_resolve summary
2003-01-21
2003-01-21
2003-01-21
2003-01-21
2003-01-21
2003-01-21
2003-01-21
2003-01-21
2003-01-22
2003-01-21
2003-01-23
_q_resolve summary
Jonathan Corbet
2003-01-21
> 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

reply