Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only try to set flag_value if is_flag is true
This statement: flag_value = not self.default requires the class to have a working `__bool__` method. However, there are some classes that explicitly disable this method: - [`numpy.ndarray`](https://numpy.org/doc/stable/reference/arrays.ndarray.html) raises `ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()` - [`astropy.units.Quantity`](https://docs.astropy.org/en/stable/api/astropy.units.Quantity.html) raises `ValueError: Quantity truthiness is ambiguous, especially for logarithmic units and temperatures. Use explicit comparisons.` Move this statement so that it is only executed if `is_flag` is true.
- Loading branch information