build: Add a `__bool__` dunder to ConfigurationData

Which will be used by the `configure_file` method of the interpreter.
This commit is contained in:
Dylan Baker 2022-02-28 11:36:34 -08:00 committed by Eli Schwartz
parent b7dec69b98
commit b4a512b9f8
1 changed files with 3 additions and 0 deletions

View File

@ -2719,6 +2719,9 @@ class ConfigurationData(HoldableObject):
def __contains__(self, value: str) -> bool:
return value in self.values
def __bool__(self) -> bool:
return bool(self.values)
def get(self, name: str) -> T.Tuple[T.Union[str, int, bool], T.Optional[str]]:
return self.values[name] # (val, desc)