coveralls: ## Pull Request Test Coverage Report for [Build 170](https://coveralls.io/builds/26881976)

* **2** of **2**   **(100.0%)**  changed or added relevant lines in **1** file are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage increased (+**0.005%**) to **98.063%**

---



|  Totals | [![Coverage Status](https://coveralls.io/builds/26881976/badge)](https://coveralls.io/builds/26881976) |
| :-- | --: |
| Change from base [Build 163](https://coveralls.io/builds/26881728): |  0.005% |
| Covered Lines: | 810 |
| Relevant Lines: | 826 |

---
##### 💛  - [Coveralls](https://coveralls.io)

diff --git a/news/40.bugfix b/news/40.bugfix
new file mode 100644
index 0000000..8163863
--- /dev/null
+++ b/news/40.bugfix
@@ -0,0 +1,1 @@
+Fix an error when expanding an empty dictionary in PyCharm debugger
diff --git a/omegaconf/dictconfig.py b/omegaconf/dictconfig.py
index 5b35776..9f81527 100644
--- a/omegaconf/dictconfig.py
+++ b/omegaconf/dictconfig.py
@@ -68,6 +68,10 @@ class DictConfig(Config):
         :param key:
         :return:
         """
+        # PyCharm is sometimes inspecting __members__. returning None or throwing is
+        # confusing it and it prints an error when inspecting this object.
+        if key == "__members__":
+            return {}
         return self.get(key=key, default_value=None)
 
     def __getitem__(self, key):

Error expanding an DictConfig in pycharm debugger
OmegaConf.create(dict(foo={}))

expanding foo results in a stack trace in the debugger.

diff --git a/tests/test_basic_ops_dict.py b/tests/test_basic_ops_dict.py
index 55af782..d968908 100644
--- a/tests/test_basic_ops_dict.py
+++ b/tests/test_basic_ops_dict.py
@@ -391,3 +391,9 @@ def test_get_with_default_from_struct_not_throwing():
     c = OmegaConf.create(dict(a=10, b=20))
     OmegaConf.set_struct(c, True)
     assert c.get("z", "default") == "default"
+
+
+def test_members():
+    # Make sure accessing __members__ does not return None or throw.
+    c = OmegaConf.create({"foo": {}})
+    assert c.__members__ == {}

pip install -e .[dev]
parse_log_pytest
pytest
pytest pre-commit
pre-commit install
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
argcomplete==3.1.2
attrs @ file:///croot/attrs_1668696182826/work
black==23.3.0
bleach==6.0.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
cfgv==3.3.1
charset-normalizer==3.4.1
click==8.1.8
click-default-group==1.2.4
colorlog==6.9.0
coverage==6.5.0
coveralls==3.3.1
cryptography==44.0.2
distlib==0.3.9
docopt==0.6.2
docutils==0.20.1
filelock==3.12.2
flake8==5.0.4
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
identify==2.5.24
idna==3.10
importlib-metadata==4.2.0
importlib-resources==5.12.0
incremental==22.10.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
jaraco.classes==3.2.3
jeepney==0.9.0
Jinja2==3.1.6
keyring==23.9.3
markdown-it-py==2.2.0
MarkupSafe==2.1.5
mccabe==0.7.0
mdurl==0.1.2
more-itertools==9.1.0
mypy-extensions==1.0.0
nodeenv==1.9.1
nox==2024.4.15
-e git+https://github.com/omry/omegaconf.git@6c581705d7baec14f8702ba5f02aa2e1803fc1b2#egg=omegaconf
packaging @ file:///croot/packaging_1671697413597/work
pathspec==0.11.2
pkginfo==1.10.0
platformdirs==2.6.2
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
pre-commit==2.21.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pycodestyle==2.9.1
pycparser==2.21
pyflakes==2.5.0
Pygments==2.17.2
pytest==7.1.2
PyYAML==6.0.1
readme-renderer==37.3
requests==2.31.0
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.8.1
SecretStorage==3.3.3
six==1.17.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
towncrier==23.6.0
twine==4.0.2
typed-ast==1.5.5
typing_extensions==4.7.1
urllib3==2.0.7
virtualenv==20.16.2
webencodings==0.5.1
zipp @ file:///croot/zipp_1672387121353/work

name: omegaconf
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
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_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=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argcomplete==3.1.2
      - black==23.3.0
      - bleach==6.0.0
      - cffi==1.15.1
      - cfgv==3.3.1
      - charset-normalizer==3.4.1
      - click==8.1.8
      - click-default-group==1.2.4
      - colorlog==6.9.0
      - coverage==6.5.0
      - coveralls==3.3.1
      - cryptography==44.0.2
      - distlib==0.3.9
      - docopt==0.6.2
      - docutils==0.20.1
      - filelock==3.12.2
      - flake8==5.0.4
      - identify==2.5.24
      - idna==3.10
      - importlib-metadata==4.2.0
      - importlib-resources==5.12.0
      - incremental==22.10.0
      - jaraco-classes==3.2.3
      - jeepney==0.9.0
      - jinja2==3.1.6
      - keyring==23.9.3
      - markdown-it-py==2.2.0
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - mdurl==0.1.2
      - more-itertools==9.1.0
      - mypy-extensions==1.0.0
      - nodeenv==1.9.1
      - nox==2024.4.15
      - omegaconf==1.4.0rc2
      - pathspec==0.11.2
      - pkginfo==1.10.0
      - platformdirs==2.6.2
      - pre-commit==2.21.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pyyaml==6.0.1
      - readme-renderer==37.3
      - requests==2.31.0
      - requests-toolbelt==1.0.0
      - rfc3986==2.0.0
      - rich==13.8.1
      - secretstorage==3.3.3
      - six==1.17.0
      - towncrier==23.6.0
      - twine==4.0.2
      - typed-ast==1.5.5
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - virtualenv==20.16.2
      - webencodings==0.5.1
prefix: /opt/conda/envs/omegaconf

tests/test_basic_ops_dict.py::test_members
tests/test_basic_ops_dict.py::test_setattr_deep_value tests/test_basic_ops_dict.py::test_setattr_deep_from_empty tests/test_basic_ops_dict.py::test_setattr_deep_map tests/test_basic_ops_dict.py::test_getattr tests/test_basic_ops_dict.py::test_getattr_dict tests/test_basic_ops_dict.py::test_mandatory_value tests/test_basic_ops_dict.py::test_nested_dict_mandatory_value tests/test_basic_ops_dict.py::test_mandatory_with_default tests/test_basic_ops_dict.py::test_subscript_get tests/test_basic_ops_dict.py::test_subscript_set tests/test_basic_ops_dict.py::test_pretty_dict tests/test_basic_ops_dict.py::test_default_value tests/test_basic_ops_dict.py::test_get_default_value tests/test_basic_ops_dict.py::test_scientific_notation_float tests/test_basic_ops_dict.py::test_dict_get_with_default tests/test_basic_ops_dict.py::test_map_expansion tests/test_basic_ops_dict.py::test_items tests/test_basic_ops_dict.py::test_items2 tests/test_basic_ops_dict.py::test_items_with_interpolation tests/test_basic_ops_dict.py::test_dict_keys tests/test_basic_ops_dict.py::test_pickle_get_root tests/test_basic_ops_dict.py::test_iterate_dictionary tests/test_basic_ops_dict.py::test_dict_pop tests/test_basic_ops_dict.py::test_in_dict[conf0-a-True] tests/test_basic_ops_dict.py::test_in_dict[conf1-b-True] tests/test_basic_ops_dict.py::test_in_dict[conf2-c-False] tests/test_basic_ops_dict.py::test_in_dict[conf3-b-True] tests/test_basic_ops_dict.py::test_in_dict[conf4-b-False] tests/test_basic_ops_dict.py::test_in_dict[conf5-c-False] tests/test_basic_ops_dict.py::test_in_dict[conf6-b-False] tests/test_basic_ops_dict.py::test_in_dict[conf7-a-True] tests/test_basic_ops_dict.py::test_get_root tests/test_basic_ops_dict.py::test_get_root_of_merged tests/test_basic_ops_dict.py::test_dict_config tests/test_basic_ops_dict.py::test_dict_delitem tests/test_basic_ops_dict.py::test_dict_len tests/test_basic_ops_dict.py::test_dict_assign_illegal_value tests/test_basic_ops_dict.py::test_dict_assign_illegal_value_nested tests/test_basic_ops_dict.py::test_assign_dict_in_dict tests/test_basic_ops_dict.py::test_to_container tests/test_basic_ops_dict.py::test_pretty_without_resolve tests/test_basic_ops_dict.py::test_pretty_with_resolve tests/test_basic_ops_dict.py::test_instantiate_config_fails tests/test_basic_ops_dict.py::test_dir tests/test_basic_ops_dict.py::test_dict_eq[input10-input20] tests/test_basic_ops_dict.py::test_dict_eq[input11-input21] tests/test_basic_ops_dict.py::test_dict_eq[input12-input22] tests/test_basic_ops_dict.py::test_dict_eq[input13-input23] tests/test_basic_ops_dict.py::test_dict_eq[input14-input24] tests/test_basic_ops_dict.py::test_dict_eq[input15-input25] tests/test_basic_ops_dict.py::test_dict_eq[input16-input26] tests/test_basic_ops_dict.py::test_dict_eq[input17-input27] tests/test_basic_ops_dict.py::test_dict_eq_with_interpolation[input10-input20] tests/test_basic_ops_dict.py::test_dict_not_eq[input10-input20] tests/test_basic_ops_dict.py::test_dict_not_eq[input11-input21] tests/test_basic_ops_dict.py::test_dict_not_eq[input12-input22] tests/test_basic_ops_dict.py::test_dict_not_eq[input13-input23] tests/test_basic_ops_dict.py::test_dict_not_eq[input14-input24] tests/test_basic_ops_dict.py::test_dict_not_eq[input15-input25] tests/test_basic_ops_dict.py::test_dict_not_eq[input16-input26] tests/test_basic_ops_dict.py::test_dict_not_eq[input17-input27] tests/test_basic_ops_dict.py::test_dict_not_eq[input18-input28] tests/test_basic_ops_dict.py::test_config_eq_mismatch_types tests/test_basic_ops_dict.py::test_dict_not_eq_with_another_class tests/test_basic_ops_dict.py::test_hash tests/test_basic_ops_dict.py::test_get_with_default_from_struct_not_throwing
omegaconf/dictconfig.py news/40.bugfix
omegaconf/dictconfig.py news/40.bugfix