Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/rich/_pick.py: 83%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

6 statements  

1def pick_bool(*values: bool | None) -> bool: 

2 """Pick the first non-none bool or return the last value. 

3 

4 Args: 

5 *values (bool): Any number of boolean or None values. 

6 

7 Returns: 

8 bool: First non-none boolean. 

9 """ 

10 assert values, "1 or more values required" 

11 for value in values: 

12 if value is not None: 

13 return value 

14 return bool(value)