Closed eihli closed 5 months ago
Better yet, I think we should update all of these to use isinstance(task, [TextTask | ControlTask])
rather than task.task_type == TaskTypeEnum.[TextTask | ControlTask]
because isinstance
provides type narrowing which lets our IDEs provide us helpful info.
See the image below for an example. In this case, it doesn't really matter, because the type complaint is about things that coerce to Falsey either way. But I still think it's a worthwhile change.
Looks good to me, but requires conflicts to be resolved @eihli :)
<Enum>.value
has typestr
, which could be anything. This PR updates all references of type TaskTypeEnum to be checks against the Enum itself rather than it's value.