ret = getattr(cls, key, obj)
                if ret is obj:
                    return False
                # for dataclasses, this could be the
                # 'default' of the field.  so filter more specifically
                # for an already-mapped InstrumentedAttribute
                if ret is not absent and isinstance(
                    ret, InstrumentedAttribute
                ):
                    return True
                if all_field is obj:
                    return False
                elif all_field is not absent:
                    return True
                # can't find another attribute
                return False
        return attribute_is_overridden
    _include_dunders = {
        "__table__",
        "__mapper_args__",
        "__tablename__",
        "__table_args__",
    }
    _match_exclude_dunders = re.compile(r"^(?:_sa_|__)")
    def _cls_attr_resolver(
        self, cls: Type[Any]
    ) -> Callable[[], Iterable[Tuple[str, Any, Any, bool]]]:
        """produce a function to iterate the "attributes" of a class
        which we want to consider for mapping, adjusting for SQLAlchemy fields
        embedded in dataclass fields.
        """
        cls_annotations = util.get_annotations(cls)
        cls_vars = vars(cls)
        _include_dunders = self._include_dunders
        _match_exclude_dunders = self._match_exclude_dunders
        names = [
            n
            for n in util.merge_lists_w_ordering(
                list(cls_vars), list(cls_annotations)
            )
            if not _match_exclude_dunders.match(n) or n in _include_dunders
        ]
        if self.allow_dataclass_fields:
            sa_dataclass_metadata_key: Optional[str] = _get_immediate_cls_attr(
                cls, "__sa_dataclass_metadata_key__"