Pass items or `DefaultPlaceholder`s by descending priority. The first one to _not_ be a `DefaultPlaceholder` will be returned. Otherwise, the first item (a `DefaultPlaceholder`) will be returned.
(
first_item: DefaultPlaceholder | DefaultType,
*extra_items: DefaultPlaceholder | DefaultType,
)
| 119 | |
| 120 | |
| 121 | def get_value_or_default( |
| 122 | first_item: DefaultPlaceholder | DefaultType, |
| 123 | *extra_items: DefaultPlaceholder | DefaultType, |
| 124 | ) -> DefaultPlaceholder | DefaultType: |
| 125 | """ |
| 126 | Pass items or `DefaultPlaceholder`s by descending priority. |
| 127 | |
| 128 | The first one to _not_ be a `DefaultPlaceholder` will be returned. |
| 129 | |
| 130 | Otherwise, the first item (a `DefaultPlaceholder`) will be returned. |
| 131 | """ |
| 132 | items = (first_item,) + extra_items |
| 133 | for item in items: |
| 134 | if not isinstance(item, DefaultPlaceholder): |
| 135 | return item |
| 136 | return first_item |
no outgoing calls
no test coverage detected
searching dependent graphs…