Python Professional — Hard
Key points
- Metaclasses are used to control the creation of classes and instances
- `__new__` is responsible for creating instances
- Singleton pattern ensures only one instance of a class exists
- Using `__init__` or `@staticmethod` won't guarantee a single instance
Ready to go further?
Related questions
