Generic number class code
Your code looks very good for me, what I found are just some minor improvements:


You do not need to inherit from object so you can just do class temp:
I would suggest to change temporary class name to something else since when you do print(type(x)) I would rather see something more informative than &lt;class '__main__.create_number_class.&lt;locals&gt;.temp'&gt;. I would suggest to add another argument for your method called className and set it dynamically as shown here
New lines after each method would be appreciated since it would make code more readable