This is an implementation of the singleton without using the __new__ class but by implementing the __call__ method in the metaclass.
Python, 22 lines
If you want a class instance to behave a certian way when it is called (i.e. obj() ) you implement its class __call__ method. If you want the class definition to behave in a certian way when called, you implement its metaclass __call__ method.
Usually (i.e. the type class) this method returns a new object, but you can do whatever you want here.
This specific implementation has a different instance per different init calls (good for immutable but changing classes, like numeric-type classes), but you can change that as you want.