Define type of 'module' object that is imported
Zachary Pincus
zpincus at stanford.edu
Fri Apr 21 13:51:44 EDT 2006
More information about the Python-list mailing list
Fri Apr 21 13:51:44 EDT 2006
- Previous message (by thread): Define type of 'module' object that is imported
- Next message (by thread): Define type of 'module' object that is imported
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi folks, I'm sure this has come up before, but the search terms I've been using are so non-specific that I can't get any traction on Google. Here's my question: I have written a subclass of ModuleType that handles lazy loading of some slow resources. I would like a given module to be created as an instance of that particular subclass on import, so that if I do: import foo type(foo) I get <type 'myModule'> instead of <type 'module'>. Is there any way to effect this? Something like __metaclass__ = ... but at the beginning of a module instead of at the beginning of a class? Thanks, Zach Pincus Program in Biomedical Informatics and Department of Biochemistry Stanford University School of Medicine
- Previous message (by thread): Define type of 'module' object that is imported
- Next message (by thread): Define type of 'module' object that is imported
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list