In Google App Engine there is a webapp2
function called import_string
. For more info see here:https://webapp-improved.appspot.com/api/webapp2.html
So,
import webapp2
my_class = webapp2.import_string('my_package.my_module.MyClass')
For example this is used in the webapp2.Route
where you can either use a handler or a string.