How to use types.new_class method in python3.3 later?
The following is sigunature.
types.new_class(name, bases=(), kwds=None, exec_body=None)
How to use exec_body?
exec_body must be callable object, and it take a argument ns. (maybe it means namespace)
what type object should pass to ns?
According to documentation of new_class,
The exec_body argument is a callback that is used to populate the freshly created class namespace. It should accept the class namespace as its sole argument and update the namespace directly with the class contents. If no callback is provided, it has the same effect as passing in lambda ns: ns.
I have no idea meaning of above description about ns and exec_body.
How can I use this function?