File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import logging
2+ from abc import ABC , abstractmethod
23from functools import cached_property
34from typing import Any
45
2122tracer = trace .get_tracer ("plain.flags" )
2223
2324
24- class Flag :
25+ class Flag (ABC ):
26+ @abstractmethod
2527 def get_key (self ) -> Any :
2628 """
2729 Determine a unique key for this instance of the flag.
@@ -32,8 +34,9 @@ def get_key(self) -> Any:
3234
3335 Return a falsy value if you don't want to store the flag result.
3436 """
35- raise NotImplementedError
37+ ...
3638
39+ @abstractmethod
3740 def get_value (self ) -> Any :
3841 """
3942 Compute the resulting value of the flag.
@@ -43,7 +46,7 @@ def get_value(self) -> Any:
4346 If get_key() returns a value, this will only be called once per key
4447 and then subsequent calls will return the saved value from the DB.
4548 """
46- raise NotImplementedError
49+ ...
4750
4851 def get_db_name (self ) -> str :
4952 """
You can’t perform that action at this time.
0 commit comments