Skip to content

Commit

Permalink
Set the truthiness value of BackgroundList
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arunkannawadi authored Nov 8, 2024
1 parent 0dd1f48 commit 79e7707
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/lsst/afw/math/_backgroundList.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def __getitem__(self, *args):
def __len__(self, *args):
return self._backgrounds.__len__(*args)

def __bool__(self, *args, **kwargs):
return self._backgrounds.__bool__(*args, **kwargs)

def append(self, val):
try:
bkgd, interpStyle, undersampleStyle, approxStyle, \
Expand Down

0 comments on commit 79e7707

Please sign in to comment.