Skip to content

setdefault not work #24

@MidoriYakumo

Description

@MidoriYakumo

It's interesting that setdefault does not call __setitem__

from easydict import EasyDict

a = EasyDict()
a['a'] = a
print(a['a'])
print(a.a)
a.setdefault('b', 2)
print(a['b'])
print(a.b) # <--- AttributeError: 'EasyDict' object has no attribute 'b'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions