has_trait

Widget.has_trait(name: str) bool

Returns True if the object has a trait with the specified name.