On Feb 23, 2004, at 8:04 PM, Bob Ippolito wrote:
Extracting data from zip files is not strictly desired or necessary
as we have bundles on OS X, temp files suck, most data files probably
aren't going to compress very well anyhow.
Things I don't like about this implementation:
* It's up to the module developer to ensure that their
"images/sample.jpg" is a unique filename that another module
developer will not use or else PathFinder might find the wrong file.
This is very bad, because if the module developers can screw this up
they definitely will. Forcing them to specify a key, like __name__
or perhaps "org.pygame", is more sensible because it isolates
packages from each other.
I think you may have misread the code. PathFinder uses the same path
resolution techniques as Python itself (with the exception that it
doesn't use sys.meta_path). That is, it searches every
entry on sys.path, seeing if the relative path supplied by the caller
can be resolved by joining with the current sys.path entry.
But the python import mechanism knows what module you're importing
from, your API does not. sys.path is a fallback mechanism gets used if
the module can not be found relative to the module doing the importing.
Your mechanism ONLY uses the fallback mechanism, so if pygame wants
"image/sample.jpg" and foobazmodule wants "image/sample.jpg", it's not
really possible to have both of them get what they want without an API
change.