Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Make read_only property, well, read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticfall committed Aug 29, 2020
1 parent 5b29c04 commit c06c90f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion alleycat/reactive/value.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ReactiveValue(Generic[T], ABC):

def __init__(self, read_only=False) -> None:
self._name: Optional[str] = None
self.read_only = read_only
self._read_only = read_only

data: RequiresContext[Any, ReactiveValue.Data[T]] = RequiresContext(lambda obj: self._get_data(obj))

Expand All @@ -44,6 +44,10 @@ def __init__(self, read_only=False) -> None:
def name(self) -> Optional[str]:
return self._name

@property
def read_only(self) -> bool:
return self._read_only

def observable(self, obj: Any) -> Observable:
if obj is None:
raise ValueError("Cannot observe a None object.")
Expand Down

0 comments on commit c06c90f

Please sign in to comment.