mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 15:53:57 +08:00
* flags
* update ref
* use the flags directly
* use post_init (don't freeze)
* we can maintain frozen with custom class
* not preglobal
* move to common
* cleanup
old-commit-hash: 3a6c3315ab
12 lines
271 B
Python
12 lines
271 B
Python
class Freezable:
|
|
_frozen: bool = False
|
|
|
|
def freeze(self):
|
|
if not self._frozen:
|
|
self._frozen = True
|
|
|
|
def __setattr__(self, *args, **kwargs):
|
|
if self._frozen:
|
|
raise Exception("cannot modify frozen object")
|
|
super().__setattr__(*args, **kwargs)
|