File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,9 @@ class dict_item:
213
213
"Descriptor" trick to easily add attribute-style access
214
214
to standard dictionary items (with optional default values).
215
215
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
+
216
219
Create an attribute in a custom dict subclass that accesses
217
220
the dict value keyed by the attribute's name:
218
221
@@ -250,6 +253,9 @@ class dict_item:
250
253
251
254
This class implements the descriptor protocol.
252
255
"""
256
+
257
+ # TODO: deprecate usage of this descriptor trick and migrate to dataclasses or attrs
258
+
253
259
_DEFAULT_UNSET = object ()
254
260
255
261
def __init__ (self , default = _DEFAULT_UNSET ):
You can’t perform that action at this time.
0 commit comments