AttrDict icon indicating copy to clipboard operation
AttrDict copied to clipboard

Using the "recursive" param shouldn't show "recursive" as an attribute

Open nrhinehart opened this issue 6 years ago • 0 comments

The recursive parameter shouldn't modify the contents of the object.

>>> attrdict.AttrDict({'list': [{'value': 1}, {'value': 2}]}, recursive=False)
AttrDict({'list': [{'value': 1}, {'value': 2}], 'recursive': False})

Let's say I have an AttrDict object for which my keys should be all numbers. Recursive should not be added to the keys.

>>> ad=attrdict.AttrDict({1: 'one', 2: 'two'}, recursive=False)
>>> ad.keys()
dict_keys([1, 2, 'recursive'])

nrhinehart avatar Aug 16 '18 21:08 nrhinehart