Skip to content

Commit ecac5e2

Browse files
committed
Make DetailsDict private and add docstring
1 parent 33a35a5 commit ecac5e2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mne/annotations.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,13 @@
5959
_datetime = datetime
6060

6161

62-
class DetailsDict(dict):
62+
class _DetailsDict(dict):
63+
"""A dictionary for storing details of annotations.
64+
65+
The keys of the dictionary are strings, and the values can be
66+
strings, integers, floats, or None.
67+
"""
68+
6369
def __setitem__(self, key: str, value: str | int | float | None) -> None:
6470
_validate_type(key, str, "key", "string")
6571
_check_forbidden_values(
@@ -82,13 +88,13 @@ def _validate_details(details, length: int):
8288
f"Details must be None or a list of length {length}, got {len(details)}."
8389
)
8490
for i, d in enumerate(details):
85-
_validate_type(d, (dict, DetailsDict, None), f"details[{i}]", "dict or None")
91+
_validate_type(d, (dict, _DetailsDict, None), f"details[{i}]", "dict or None")
8692
out = []
8793
for d in details:
8894
if d is None:
8995
out.append(None)
9096
else:
91-
dd = DetailsDict()
97+
dd = _DetailsDict()
9298
dd.update(d)
9399
out.append(dd)
94100
return out

0 commit comments

Comments
 (0)