Message32565
Hrm. Well then we can either add something like __source_file__ to modules, put 'reload' into the imp module (or on module objects as a method), or have a function in imp (or as a method on modules) that returns the source path (if it exists).
But having to do::
M.__file__.rsplit('.', 1) + filter((lambda x : x[2] == imp.PY_SOURCE), imp.get_suffixes())[0]
seems like a lot to memorize (let alone type in), especially since there is even no error checking that the path is even to a source or bytecode file to start with or that you end up with. |
|
Date |
User |
Action |
Args |
2007-08-23 14:58:53 | admin | link | issue1762972 messages |
2007-08-23 14:58:53 | admin | create | |
|