Skip to content

Commit 301e344

Browse files
committed
deprecate dict_item
1 parent ccffe3e commit 301e344

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

openeo_driver/utils.py

+6
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ class dict_item:
213213
"Descriptor" trick to easily add attribute-style access
214214
to standard dictionary items (with optional default values).
215215
216+
Note: instead of this simple trick, consider using any of the more standard, widely used solutions
217+
like dataclasses from Python stdlib, or something like attrs (https://www.attrs.org).
218+
216219
Create an attribute in a custom dict subclass that accesses
217220
the dict value keyed by the attribute's name:
218221
@@ -250,6 +253,9 @@ class dict_item:
250253
251254
This class implements the descriptor protocol.
252255
"""
256+
257+
# TODO: deprecate usage of this descriptor trick and migrate to dataclasses or attrs
258+
253259
_DEFAULT_UNSET = object()
254260

255261
def __init__(self, default=_DEFAULT_UNSET):

0 commit comments

Comments
 (0)