I found in saucelabs example.py file the following code snippet using the import new module.
example.py
import new
import new # .. snip .. def on_platforms(p
The type keyword is a class. You can perform the above using
type
module[name] = type(name, (base_class,), d)
This will return a class of name name with the tuple parameters of the base class base_class, initializing the member objects with the dict d.
name
base_class
dict
d