Message158490
Well, if you want backward compatibility, you pretty much have to keep it as is, don't you?
This is the only time I've used load_source, and it was used because we didn't want to bother mucking with the path but did want to load the module whose file system location we knew.
SourceFileLoader(name, path).load_source() is OK, but it does not qualify as an obvious API for loading a module not on the path whose file system path one knows. I'm OK with there not being an obvious API for that as long as there *is* an API for it.
To be clear: importlib.import_module(name) lets you load a module that *is* on the path, so it seems logical that there would be a corresponding function (load_file?) that would take a complete path and thereby allow you to load a module *not* on sys.path. But there is by no means a *requirement* for such a function in my mind, as long as it can be done somehow. |
|
Date |
User |
Action |
Args |
2012-04-16 18:10:49 | r.david.murray | set | recipients:
+ r.david.murray, brett.cannon, pitrou, eric.snow |
2012-04-16 18:10:49 | r.david.murray | set | messageid: <1334599849.02.0.985236124135.issue14551@psf.upfronthosting.co.za> |
2012-04-16 18:10:48 | r.david.murray | link | issue14551 messages |
2012-04-16 18:10:48 | r.david.murray | create | |
|