The API would be an attribute: module.__stdlib__ (bool). The attribute could be set directly in the module code. For example, add "__stdlib__ = True" in Python modules. Similar idea for C extension modules. Or the attribute could be set after importing the module, in the import sit...
self.path_module =namedModule("ntpath")else:# most everything accepts / as separator, so posix should be a# reasonable fallbackself.path_module =namedModule("posixpath") log.msg("bot attached") self.messageReceivedFromSlave() self.stopMissingTimer() self.botmaster.master.status.slaveConnected(...