Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursionError for inherited class from EasyDict #20

Open
kingsj0405 opened this issue Apr 30, 2020 · 0 comments
Open

RecursionError for inherited class from EasyDict #20

kingsj0405 opened this issue Apr 30, 2020 · 0 comments

Comments

@kingsj0405
Copy link

Environment

# uname -a
Linux 79407f72f74b 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
# python --version
Python 3.7.4

What I want to do

>>> class A(EasyDict):
...     B = EasyDict()
...
>>> a = A()
>>>

What happens

>>> class A(EasyDict):
...     B = EasyDict()
...
>>> a = A()
.
.
.
    setattr(self, k, getattr(self, k))
  File "/opt/conda/lib/python3.7/site-packages/easydict/__init__.py", line 129, in __setattr__
    value = self.__class__(value)
  File "/opt/conda/lib/python3.7/site-packages/easydict/__init__.py", line 122, in __init__
    setattr(self, k, getattr(self, k))
  File "/opt/conda/lib/python3.7/site-packages/easydict/__init__.py", line 129, in __setattr__
    value = self.__class__(value)
  File "/opt/conda/lib/python3.7/site-packages/easydict/__init__.py", line 122, in __init__
    setattr(self, k, getattr(self, k))
  File "/opt/conda/lib/python3.7/site-packages/easydict/__init__.py", line 129, in __setattr__
    value = self.__class__(value)
  File "/opt/conda/lib/python3.7/site-packages/easydict/__init__.py", line 120, in __init__
    for k in self.__class__.__dict__.keys():
RecursionError: maximum recursion depth exceeded while calling a Python object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant