merge class attrs and instance attrs in get_type_hierarchy