[Python-Dev] type categories
Greg Ewing
greg@cosc.canterbury.ac.nz
Sat, 17 Aug 2002 14:08:34 +1200 (NZST)
Andrew Koenig <ark@research.att.com>:
> if I know that modules x and y overload the same function,
> and I want to be sure that x's case is tested first, one would think I
> could ensure it by writing
>
> import x, y
>
> But in fact I can't, because someone else may have imported y already,
> in which case the second import is a no-op.
So far no-one has addressed the other importing problem
I mentioned, which is how to ensure that the relevant
modules get imported *at all*.
Currently in Python, a module gets imported because
some other module needs to use a name from it. If no
other module needs to do so, the module is not needed.
But with generic functions, this will no longer be
true. It will be possible for a module to be needed
by the system as a whole, yet no other module knows
that it is needed!
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg@cosc.canterbury.ac.nz +--------------------------------------+