You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, if the `keyattr_dynamic` is not explicitly set to `True`, this functionality works for get/set only already existing items.
100
+
99
101
#### Disable keyattr functionality
100
-
You can disable the keyattr functionality passing `keyattr_enabled=False` in the constructor.
102
+
You can disable the keyattr functionality passing `keyattr_enabled=False`option in the constructor.
101
103
102
104
```python
103
-
d = benedict(existing_dict, keyattr_enabled=False)
105
+
d = benedict(existing_dict, keyattr_enabled=False)# default True
104
106
```
105
107
106
-
You can disable the keyattr functionality using the `getter/setter` property.
108
+
or using the `getter/setter` property.
107
109
108
110
```python
109
111
d.keyattr_enabled =False
110
112
```
111
113
114
+
#### Dynamic keyattr functionality
115
+
You can enable the dynamic attributes access functionality passing `keyattr_dynamic=True` in the constructor.
116
+
117
+
```python
118
+
d = benedict(existing_dict, keyattr_dynamic=True) # default False
119
+
```
120
+
121
+
or using the `getter/setter` property.
122
+
123
+
```python
124
+
d.keyattr_dynamic =True
125
+
```
126
+
112
127
> **Warning** - even if this feature is very useful, it has some obvious limitations: it works only for string keys that are *unprotected* (not starting with an `_`) and that don't clash with the currently supported methods names.
113
128
114
129
### Keylist
@@ -173,13 +188,13 @@ d.keypath_separator = "/"
173
188
```
174
189
175
190
#### Disable keypath functionality
176
-
You can disable the keypath functionality passing `keypath_separator=None` in the constructor.
191
+
You can disable the keypath functionality passing `keypath_separator=None`option in the constructor.
177
192
178
193
```python
179
194
d = benedict(existing_dict, keypath_separator=None)
180
195
```
181
196
182
-
You can disable the keypath functionality using the `getter/setter` property.
0 commit comments