mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
14 lines
319 B
Python
14 lines
319 B
Python
|
class Dirty:
|
||
|
def __init__(self, initial_value):
|
||
|
self.initial_value = initial_value
|
||
|
self.value = initial_value
|
||
|
|
||
|
def is_clean(self):
|
||
|
return self.initial_value == self.value
|
||
|
|
||
|
def is_dirty(self):
|
||
|
return not self.is_clean()
|
||
|
|
||
|
def __bool__(self):
|
||
|
return self.is_dirty()
|