From c49e5c96df9f4dc944e0330b43dc09eb2099120e Mon Sep 17 00:00:00 2001 From: Arun Kannawadi Date: Thu, 7 Nov 2024 23:46:17 -0500 Subject: [PATCH] Set the truthiness value of BackgroundList BackgroundList is expected to behave like a Python list. It is therefore natural to expect initializing an instance with no arguments to evaluate to False. --- python/lsst/afw/math/_backgroundList.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/lsst/afw/math/_backgroundList.py b/python/lsst/afw/math/_backgroundList.py index 656687d077..7e35d518a9 100644 --- a/python/lsst/afw/math/_backgroundList.py +++ b/python/lsst/afw/math/_backgroundList.py @@ -79,6 +79,9 @@ def __getitem__(self, *args): def __len__(self, *args): return self._backgrounds.__len__(*args) + def __bool__(self): + return bool(self._backgrounds) + def append(self, val): try: bkgd, interpStyle, undersampleStyle, approxStyle, \