Alternative way to get the singleton instance.
(cls, max_size: int = 5)
| 951 | |
| 952 | @classmethod |
| 953 | def get_instance(cls, max_size: int = 5) -> 'CacheManager': |
| 954 | """Alternative way to get the singleton instance.""" |
| 955 | if cls._instance is None: |
| 956 | return cls(max_size) |
| 957 | return cls._instance |
| 958 | |
| 959 | class DeviceManager: |
| 960 | def __init__(self): |