pint.models.timing_model.property_exists

pint.models.timing_model.property_exists(f)[source]

Mark a function as a property but handle AttributeErrors.

Normal @property has the unfortunate feature that if the called function should accidentally emit an AttributeError, if __getattr__ is in use, this will be reported as if the attribute does not exist. With this decorator instead, the AttributeError will be caught and re-raised as a specific kind of ValueError, so it will be treated like an error and the backtrace printed.