diff --git a/marshmallow/utils.py b/marshmallow/utils.py
index 909d00ab..49b1c336 100644
--- a/marshmallow/utils.py
+++ b/marshmallow/utils.py
@@ -362,12 +362,13 @@ def _get_value_for_keys(obj, keys, default):
 
 
 def _get_value_for_key(obj, key, default):
+    if not hasattr(obj, '__getitem__'):
+        return getattr(obj, key, default)
+
     try:
         return obj[key]
-    except (TypeError, AttributeError):
+    except (KeyError, IndexError, TypeError, AttributeError):
         return getattr(obj, key, default)
-    except (KeyError, IndexError):
-        return default
 
 
 def set_value(dct, key, value):
@@ -393,6 +394,7 @@ def set_value(dct, key, value):
     else:
         dct[key] = value
 
+
 def callable_or_raise(obj):
     """Check that an object is callable, else raise a :exc:`ValueError`.
     """

Marshmallow 3 can't dump dict-likes with property
I'm trying to port [umongo](https://github.com/Scille/umongo) to marshmallow 3 and I stumbled upon this:

```py
import marshmallow as ma


class MyDict(dict):
    @property
    def prop(self):
        return 12


class MySchema(ma.Schema):
    prop = ma.fields.Int()


print(MySchema().dump(MyDict()))

# MA 2
MarshalResult(data={'prop': 12}, errors={})

# MA 3
{}
```

It is due to @taion's https://github.com/marshmallow-code/marshmallow/pull/811.

In `get_value`, we try to get the value as key and in case of `KeyError`, `default` is returned before even trying to get as attribute.

This is wrong for structures that can have keys and attributes.

I think this is an issue in marshmallow.
diff --git a/tests/test_utils.py b/tests/test_utils.py
index bf10a1bb..142a6d8f 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -48,18 +48,22 @@ class PointClass(object):
         self.x = x
         self.y = y
 
+class PointDict(dict):
+    def __init__(self, x, y):
+        super(PointDict, self).__init__({'x': x})
+        self.y = y
+
 @pytest.mark.parametrize(
     'obj', [
         PointNT(24, 42),
         PointClass(24, 42),
+        PointDict(24, 42),
         {'x': 24, 'y': 42},
     ],
 )
 def test_get_value_from_object(obj):
-    result = utils.get_value(obj, 'x')
-    assert result == 24
-    result2 = utils.get_value(obj, 'y')
-    assert result2 == 42
+    assert utils.get_value(obj, 'x') == 24
+    assert utils.get_value(obj, 'y') == 42
 
 def test_get_value_from_namedtuple_with_default():
     p = PointNT(x=42, y=None)

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.9
docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.12
aspy.yaml==1.3.0
babel==2.17.0
cached-property==2.0.1
cachetools==5.5.2
certifi==2025.1.31
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.4.1
colorama==0.4.6
distlib==0.3.9
docutils==0.21.2
exceptiongroup==1.2.2
filelock==3.18.0
flake8==3.6.0
identify==2.6.9
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
Jinja2==3.1.6
MarkupSafe==3.0.2
-e git+https://github.com/marshmallow-code/marshmallow.git@55932fa4e4ba7496f424ed2942d7963051030699#egg=marshmallow
mccabe==0.6.1
nodeenv==1.9.1
packaging==24.2
platformdirs==4.3.7
pluggy==1.5.0
pre-commit==1.12.0
pycodestyle==2.4.0
pyflakes==2.0.0
Pygments==2.19.1
pyproject-api==1.9.0
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
requests==2.32.3
simplejson==3.20.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==1.8.2
sphinx-issues==1.1.0
sphinx-version-warning==1.1.2
sphinxcontrib-serializinghtml==2.0.0
sphinxcontrib-websupport==1.2.4
toml==0.10.2
tomli==2.2.1
tox==4.25.0
typing_extensions==4.13.0
urllib3==2.3.0
virtualenv==20.29.3
zipp==3.21.0

name: marshmallow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.12
      - aspy-yaml==1.3.0
      - babel==2.17.0
      - cached-property==2.0.1
      - cachetools==5.5.2
      - certifi==2025.1.31
      - cfgv==3.4.0
      - chardet==5.2.0
      - charset-normalizer==3.4.1
      - colorama==0.4.6
      - distlib==0.3.9
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==3.6.0
      - identify==2.6.9
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jinja2==3.1.6
      - markupsafe==3.0.2
      - mccabe==0.6.1
      - nodeenv==1.9.1
      - packaging==24.2
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pre-commit==1.12.0
      - pycodestyle==2.4.0
      - pyflakes==2.0.0
      - pygments==2.19.1
      - pyproject-api==1.9.0
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - requests==2.32.3
      - simplejson==3.20.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==1.8.2
      - sphinx-issues==1.1.0
      - sphinx-version-warning==1.1.2
      - sphinxcontrib-serializinghtml==2.0.0
      - sphinxcontrib-websupport==1.2.4
      - toml==0.10.2
      - tomli==2.2.1
      - tox==4.25.0
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - virtualenv==20.29.3
      - zipp==3.21.0
prefix: /opt/conda/envs/marshmallow

tests/test_utils.py::test_get_value_from_object[obj2]
tests/test_utils.py::test_to_marshallable_type tests/test_utils.py::test_to_marshallable_type_none tests/test_utils.py::test_to_marshallable_type_with_namedtuple tests/test_utils.py::test_get_value_from_object[obj0] tests/test_utils.py::test_get_value_from_object[obj1] tests/test_utils.py::test_get_value_from_object[obj3] tests/test_utils.py::test_get_value_from_namedtuple_with_default tests/test_utils.py::test_get_value_for_nested_object tests/test_utils.py::test_get_value_from_dict tests/test_utils.py::test_get_value tests/test_utils.py::test_set_value tests/test_utils.py::test_is_keyed_tuple tests/test_utils.py::test_to_marshallable_type_list tests/test_utils.py::test_to_marshallable_type_generator tests/test_utils.py::test_marshallable tests/test_utils.py::test_is_collection tests/test_utils.py::test_rfcformat_gmt_naive tests/test_utils.py::test_rfcformat_central tests/test_utils.py::test_rfcformat_central_localized tests/test_utils.py::test_isoformat tests/test_utils.py::test_isoformat_tzaware tests/test_utils.py::test_isoformat_localtime tests/test_utils.py::test_from_rfc[True] tests/test_utils.py::test_from_rfc[False] tests/test_utils.py::test_from_iso_datetime[True] tests/test_utils.py::test_from_iso_datetime[False] tests/test_utils.py::test_from_iso_with_tz tests/test_utils.py::test_from_iso_time_with_microseconds[True] tests/test_utils.py::test_from_iso_time_with_microseconds[False] tests/test_utils.py::test_from_iso_time_without_microseconds[True] tests/test_utils.py::test_from_iso_time_without_microseconds[False] tests/test_utils.py::test_from_iso_date[True] tests/test_utils.py::test_from_iso_date[False] tests/test_utils.py::test_get_func_args
marshmallow/utils.py
marshmallow/utils.py