On Mon, Apr 05, 2004 at 04:32:09PM -0500, Jason E. Sibre wrote:
> Great... Now my ugly hack is immortalized! ;)
Well, feel free to nuke it in the wiki if you want. Doesn't make any
diff to me. :>
> Seriously, it may be worth pointing out that all three techniques have the
> same end result of adding the 'illegal-name' to the module's namespace.
Feel free to make that point, too!
> I forgot all about _q_resolve(), as I never use it... But being reminded of
> it, I think that's your cleanest option, without considering the
> modification of the _q_exports logic.
Yes, absent changing _q_exports, _q_resolve is the best, by
far. *But*, it's not particularly good if you have more than, say, 4
or 5 static illegal names. Then you end up with an ugly if-elif-else
thing, and I hate maintaining those.
> Now, given: _q_exports = ['foo', 'bar', Alias('foo-bar', 'foo_bar')]
Sorta ugly syntactically, but not *bad*. It does avoid the type-check,
but I'm skeptical it will be any better performant.
> Or something like that... Once resolved, it is permanently added to the
> correct namespace so that future checks have similar performance to the
> _q_resolve solution.
Hmm, interesting. But the performance comparison should be between yr
Alias and allowing rename tuples in _q_exports, I would think.
> Actually, a more conprehensive analysis may reveal that the check should be
> done sooner in the process, rather than at the last moment.
Yr Alias solution gets the explicit, arbitrary mapping back in, which
I like; but it's a bit more heavyweight syntactically than the literal
tuple. But I leave real analysis of performance and implementation
issues to those who know better.
Kendall
--
This sucks more than anything that has ever sucked before. -- Butthead